mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #14304 from hugueskamba/hk_cmake_remove_app_target_reference
CMake: Refactor post-build hook to remove APP_TARGET referencespull/14350/head
commit
7da6100ff6
|
@ -186,11 +186,13 @@ function(mbed_generate_bin_hex target)
|
||||||
)
|
)
|
||||||
|
|
||||||
if(TARGET mbed-post-build-bin-${MBED_TARGET})
|
if(TARGET mbed-post-build-bin-${MBED_TARGET})
|
||||||
add_custom_target(mbed-post-build
|
# The artefacts must be created before they can be further manipulated
|
||||||
ALL
|
add_dependencies(mbed-post-build-bin-${MBED_TARGET} ${target})
|
||||||
DEPENDS
|
|
||||||
mbed-post-build-bin-${MBED_TARGET}
|
# Add a post-build hook to the top-level CMake target in the form of a
|
||||||
)
|
# CMake custom target. The hook depends on Mbed target specific
|
||||||
|
# post-build CMake target which has a custom command attached to it.
|
||||||
|
add_custom_target(mbed-post-build ALL DEPENDS mbed-post-build-bin-${MBED_TARGET})
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
|
@ -6,16 +6,11 @@
|
||||||
#
|
#
|
||||||
macro(mbed_set_post_build_operation)
|
macro(mbed_set_post_build_operation)
|
||||||
|
|
||||||
add_custom_target(mbed-post-build-bin-${mbed_target_name}
|
add_custom_target(mbed-post-build-bin-${mbed_target_name})
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${APP_TARGET}.bin
|
|
||||||
)
|
|
||||||
|
|
||||||
# Ensures the application artefacts are created before manipulating them.
|
|
||||||
add_dependencies(mbed-post-build-bin-${mbed_target_name} ${APP_TARGET})
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
TARGET
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${APP_TARGET}.bin
|
mbed-post-build-bin-${mbed_target_name}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND
|
COMMAND
|
||||||
${post_build_command}
|
${post_build_command}
|
||||||
|
|
Loading…
Reference in New Issue