Skip to content

register_fprime_config: STATIC enforcement checks SOURCE instead of SOURCES #5970

Description

@thomas-bc-autowot
F´ Version devel (a41532a)
Affected Component cmake/API.cmakeregister_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

  1. Register a config module with SOURCES only (no AUTOCODER_INPUTS, no STATIC/INTERFACE).
  2. Generate with -DBUILD_SHARED_LIBS=ON.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions