cmake: flash: Conditional dependency to 'mergehex'

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 <haakon.amundsen@nordicsemi.no>
This commit is contained in:
Håkon Øye Amundsen 2018-12-05 09:15:40 +00:00 committed by Anas Nashif
commit 0da5d24c36
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -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}
)