register_fprime_config: STATIC enforcement checks `SOURCE` instead of `SOURCES`
Author: thomas-bc-autowotCreated Sep 14, 2026Updated Sep 16, 2026
Labelsbug
| F´ Version | devel (a41532adec) |
| 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 (378a7a3e6f).
How to Reproduce
- Register a config module with
SOURCESonly (noAUTOCODER_INPUTS, noSTATIC/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.
Source: nasa/fprime