Skip to content

Commit f338f47

Browse files
mbolivar-nordicSebastianBoe
authored andcommitted
cmake: make extra_post_build_* target properties
Move extra_post_build_command and extra_post_build_byproducts to ZEPHYR_TARGET instead of using globals. Make some whitespace adjustments while we are here to make it clearer (to grep) when we are using the property and when we are using the variable by the same name. Signed-off-by: Marti Bolivar <[email protected]>
1 parent 8882ca7 commit f338f47

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

CMakeLists.txt

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,25 +1428,15 @@ if(CONFIG_BUILD_OUTPUT_EXE)
14281428
)
14291429
endif()
14301430

1431-
get_property(extra_post_build_commands
1432-
GLOBAL PROPERTY
1433-
extra_post_build_commands
1434-
)
1435-
1436-
list(APPEND
1437-
post_build_commands
1438-
${extra_post_build_commands}
1439-
)
1440-
1441-
get_property(extra_post_build_byproducts
1442-
GLOBAL PROPERTY
1443-
extra_post_build_byproducts
1444-
)
1431+
get_target_property(extra_post_build_commands ${ZEPHYR_TARGET} extra_post_build_commands)
1432+
if(extra_post_build_commands)
1433+
list(APPEND post_build_commands ${extra_post_build_commands})
1434+
endif()
14451435

1446-
list(APPEND
1447-
post_build_byproducts
1448-
${extra_post_build_byproducts}
1449-
)
1436+
get_target_property(extra_post_build_byproducts ${ZEPHYR_TARGET} extra_post_build_byproducts)
1437+
if(extra_post_build_byproducts)
1438+
list(APPEND post_build_byproducts ${extra_post_build_byproducts})
1439+
endif()
14501440

14511441
# Add post_build_commands to post-process the final .elf file produced by
14521442
# either the ZEPHYR_PREBUILT_EXECUTABLE or the KERNEL_ELF executable

arch/arm/core/cortex_m/tz/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ if(CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCS)
2020
)
2121

2222
# Indicate that the entry veneers library file is created during linking of this firmware.
23-
set_property(
24-
GLOBAL APPEND PROPERTY
25-
extra_post_build_byproducts
23+
set_property(TARGET ${ZEPHYR_TARGET} APPEND PROPERTY extra_post_build_byproducts
2624
${CMAKE_BINARY_DIR}/${CONFIG_ARM_ENTRY_VENEERS_LIB_NAME}
2725
)
2826
endif()

boards/xtensa/intel_s1000_crb/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(CONFIG_PINMUX_INTEL_S1000)
55
zephyr_library_sources(pinmux.c)
66
endif()
77

8-
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
8+
set_property(TARGET ${ZEPHYR_TARGET} APPEND PROPERTY extra_post_build_commands
99
COMMAND ${PYTHON_EXECUTABLE} ${BOARD_DIR}/support/create_board_img.py
1010
-i ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
1111
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}_${BOARD}.bin

0 commit comments

Comments
 (0)