From 9104afa069b70cc01145cd1ec2c4e07396ef5f34 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 18 Mar 2024 11:49:03 +0100 Subject: [PATCH] cmake: change check_init_priorities target into a post build command Fixes: #70359 Remove check_init_priorities target and instead create a post build command and place the post build command on native_runner_executable, if that target is the final target, else use the normal post build list for Zephyr build target. Signed-off-by: Torsten Rasmussen --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09a4ec6b55..6c44e41c81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1812,12 +1812,13 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "ARMClang") ) if(CONFIG_CHECK_INIT_PRIORITIES) - add_custom_target( - check_init_priorities - ALL - COMMAND ${check_init_priorities_command} - DEPENDS ${check_init_priorities_dependencies} - ) + if(TARGET native_runner_executable) + add_custom_command(TARGET native_runner_executable POST_BUILD + COMMAND ${check_init_priorities_command} + ) + else() + list(APPEND post_build_commands COMMAND ${check_init_priorities_command}) + endif() endif() add_custom_target(