-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
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:
- Define a cache variable in CMakeLists.txt:
- option(FOO "Enable Foo")
- Attempt to override this variable using the west build command:
- west build --sysbuild ... -- -Dmy_sample_FOO=ON (Ref: https://docs.zephyrproject.org/latest/build/sysbuild/index.html#cmake-variable-namespacing)
- Observe that the value of FOO remains as "default_value" instead of "ON".
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