Skip to content

Commit fc16717

Browse files
tejlmandd3zd3z
authored andcommitted
cmake: Fix invocation of add_custom_command()
Fixes: zephyrproject-rtos/zephyr#79295 Fix invocation of add_custom_command() by correcting the wrong `CMAKE_EXECUTABLE` variable to the correct `CMAKE_COMMAND` variable name and added `-E` to correctly set up the environment. Export ZEPHYR_BASE when invoking the custom command to ensure that the ZEPHYR_BASE used by CMake is also the value used when invoking the build. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent d2734f4 commit fc16717

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ ${config_paths}
143143
OUTPUT ${DUMMY_FILE}
144144
BYPRODUCTS ${RUST_LIBRARY} ${WRAPPER_FILE}
145145
COMMAND
146-
${CMAKE_EXECUTABLE}
146+
${CMAKE_COMMAND} -E
147147
env BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
148+
ZEPHYR_BASE=${ZEPHYR_BASE}
148149
DOTCONFIG=${DOTCONFIG}
149150
ZEPHYR_DTS=${ZEPHYR_DTS}
150151
INCLUDE_DIRS="${include_dirs}"

0 commit comments

Comments
 (0)