Skip to content

CMake cache variable not propagated correctly in sysbuild context #88303

@PragatiGarg-eaton

Description

@PragatiGarg-eaton

Description: There appears to be an issue with the propagation of CMake cache variables when using sysbuild. Specifically, changing the value of a cache variable from the west build command does not have any impact, and the default value from CMakeLists.txt is always propagated.

Steps to Reproduce:

Expected Behavior: The value of FOO should be overridden to "ON" when specified in the west build command.

Actual Behavior: The value of FOO remains as "default_value" regardless of the override attempt.

Additional Information:
The issue persists even when using the zephyr_get function.
The CMake cache variable is not recognized by CMakeLists.txt when set via the west build command.

Sample Code:
CMakeLists.txt
option(FOO "Enable Foo")

Attempt to use the variable
message(STATUS "FOO is set to ${FOO}")

Build Command:
west build --sysbuild ... -- -Dmy_sample_FOO=ON

Environment:

Zephyr version: 3.6.0
CMake version: 3.31.6
West version: 1.2.0
Operating System: Windows

Metadata

Metadata

Assignees

Labels

area: SysbuildbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions