|
|
| F´ Version |
devel (a41532a) |
| Affected Component |
cmake/API.cmake — register_fprime_config |
Problem Description
fprime_add_config_build_target is meant to force a configuration module to STATIC when it supplies sources or autocoder inputs, but it tests the wrong directive name:
# cmake/API.cmake
function(fprime_add_config_build_target)
set(ARGN_PASS ${ARGN})
# Ensure library is STATIC when supplying SOURCE or AUTOCODER_INPUTS
if (SOURCE IN_LIST ARGN_PASS OR AUTOCODER_INPUTS IN_LIST ARGN_PASS)
The directive users pass is SOURCES, so the first test never matches. A config module with SOURCES but no AUTOCODER_INPUTS and no explicit STATIC is therefore not forced static and follows BUILD_SHARED_LIBS like any other library. In-tree config modules all have FPP inputs, so AUTOCODER_INPUTS masks this; present since #3642 (378a7a3).
How to Reproduce
- Register a config module with
SOURCES only (no AUTOCODER_INPUTS, no STATIC/INTERFACE).
- Generate with
-DBUILD_SHARED_LIBS=ON.
- Observe the target is a shared library.
Expected Behavior
The module is built STATIC, as the docstring states. Fix: SOURCE -> SOURCES on that line, plus a cmake/test case for a SOURCES-only config module under BUILD_SHARED_LIBS=ON.
devel(a41532a)cmake/API.cmake—register_fprime_configProblem Description
fprime_add_config_build_targetis meant to force a configuration module toSTATICwhen it supplies sources or autocoder inputs, but it tests the wrong directive name:The directive users pass is
SOURCES, so the first test never matches. A config module withSOURCESbut noAUTOCODER_INPUTSand no explicitSTATICis therefore not forced static and followsBUILD_SHARED_LIBSlike any other library. In-tree config modules all have FPP inputs, soAUTOCODER_INPUTSmasks this; present since #3642 (378a7a3).How to Reproduce
SOURCESonly (noAUTOCODER_INPUTS, noSTATIC/INTERFACE).-DBUILD_SHARED_LIBS=ON.Expected Behavior
The module is built
STATIC, as the docstring states. Fix:SOURCE->SOURCESon that line, plus acmake/testcase for aSOURCES-only config module underBUILD_SHARED_LIBS=ON.