Skip to content

Commit 3d04068

Browse files
erwangokartben
authored andcommitted
soc: stm32n6: Generate a warning when signing tool is not available
Generate a proper Cmake warning when signing tool isn't available. This also allows not to fail in Github CI. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 17c7303 commit 3d04068

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

soc/st/stm32/stm32n6x/CMakeLists.txt

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,25 @@ else()
1515
set(SIGNING_TOOL STM32_SigningTool_CLI)
1616
endif()
1717

18-
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
19-
COMMAND ${SIGNING_TOOL}
20-
-in ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
21-
-nk -t fsbl -hv 2.3
22-
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.signed.bin
23-
-dump ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.signed.bin
24-
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
25-
)
26-
27-
set_property(TARGET runners_yaml_props_target PROPERTY bin_file ${CONFIG_KERNEL_BIN_NAME}.signed.bin)
18+
find_file(SIGNING_TOOL_FIND ${SIGNING_TOOL})
19+
if(SIGNING_TOOL_FIND STREQUAL SIGNING_TOOL_FIND-NOTFOUND)
20+
message(WARNING "
21+
Signing Image tool (${SIGNING_TOOL}) is not available.
22+
Signed image will not be generated.
23+
You won't be able to run image on board.")
24+
endif()
25+
26+
if(NOT SIGNING_TOOL_FIND STREQUAL SIGNING_TOOL_FIND-NOTFOUND)
27+
28+
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
29+
COMMAND ${SIGNING_TOOL}
30+
-in ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
31+
-nk -t fsbl -hv 2.3
32+
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.signed.bin
33+
-dump ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.signed.bin
34+
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
35+
)
36+
37+
set_property(TARGET runners_yaml_props_target PROPERTY bin_file ${CONFIG_KERNEL_BIN_NAME}.signed.bin)
38+
39+
endif()

0 commit comments

Comments
 (0)