Skip to content

Commit f26d245

Browse files
tejlmandjhedberg
authored andcommitted
sysbuild: exclude APPLICATION_SOURCE_DIR from sysbuild image cache file
APPLICATION_SOURCE_DIR is image specific and the value inside sysbuild points to sysbuild itself. This gives wrong results when a sample uses `zephyr_get(APPLICATION_SOURCE_DIR)` as it will fetch the sysbuild value and not its own value. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent c4ab06b commit f26d245

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

share/sysbuild/cmake/modules/sysbuild_extensions.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ function(sysbuild_get variable)
8383
if(DEFINED ${variable} AND NOT DEFINED GET_VAR_VAR)
8484
message(WARNING "Return variable ${variable} already defined with a value. "
8585
"sysbuild_get(${variable} ...) may overwrite existing value. "
86-
"Please use sysbuild_get(<variable> ... VAR <image-variable>) "
87-
"where <variable> is undefined."
86+
"Please use sysbuild_get(<variable> ... VAR <image-variable>) "
87+
"where <variable> is undefined."
8888
)
8989
endif()
9090

@@ -131,7 +131,7 @@ function(sysbuild_cache)
131131
get_cmake_property(sysbuild_cache CACHE_VARIABLES)
132132

133133
foreach(var_name ${sysbuild_cache})
134-
if(NOT "${var_name}" MATCHES "^(CMAKE_.*|BOARD)$")
134+
if(NOT "${var_name}" MATCHES "^(CMAKE_.*|BOARD|APPLICATION_SOURCE_DIR)$")
135135
# Perform a dummy read to prevent a false warning about unused variables
136136
# being emitted due to a cmake bug: https://gitlab.kitware.com/cmake/cmake/-/issues/24555
137137
set(unused_tmp_var ${${var_name}})

0 commit comments

Comments
 (0)