From 0da5d24c36f48d7cfdcc7eb38bb0aa7f8f96eede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20=C3=98ye=20Amundsen?= Date: Wed, 5 Dec 2018 09:15:40 +0000 Subject: [PATCH] cmake: flash: Conditional dependency to 'mergehex' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a dependency from the 'flash' target to the 'mergehex' target IF files to be merged are configured. Signed-off-by: Håkon Øye Amundsen --- CMakeLists.txt | 1 + cmake/flash/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c43fc4077db..4a615372775 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1327,6 +1327,7 @@ if(HEX_FILES_TO_MERGE) ) add_custom_target(mergehex ALL DEPENDS ${MERGED_HEX_NAME}) + list(APPEND FLASH_DEPS mergehex) endif() if(CONFIG_OUTPUT_PRINT_MEMORY_USAGE) diff --git a/cmake/flash/CMakeLists.txt b/cmake/flash/CMakeLists.txt index 64d4c591192..839544ba124 100644 --- a/cmake/flash/CMakeLists.txt +++ b/cmake/flash/CMakeLists.txt @@ -91,6 +91,8 @@ foreach(target flash debug debugserver attach) set(comment "Debugging ${BOARD}") endif() + list(APPEND FLASH_DEPS ${logical_target_for_zephyr_elf}) + # We pass --skip-rebuild here because the DEPENDS value ensures the # build is already up to date before west is run. set(cmd @@ -101,7 +103,7 @@ foreach(target flash debug debugserver attach) ${RUNNER_VERBOSE} ${target} --skip-rebuild - DEPENDS ${logical_target_for_zephyr_elf} + DEPENDS ${FLASH_DEPS} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} )