File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -186,11 +186,13 @@ function(mbed_generate_bin_hex target)
186186 )
187187
188188 if (TARGET mbed-post-build -bin-${MBED_TARGET} )
189- add_custom_target (mbed-post-build
190- ALL
191- DEPENDS
192- mbed-post-build -bin-${MBED_TARGET}
193- )
189+ # The artefacts must be created before they can be further manipulated
190+ add_dependencies (mbed-post-build -bin-${MBED_TARGET} ${target} )
191+
192+ # Add a post-build hook to the top-level CMake target in the form of a
193+ # CMake custom target. The hook depends on Mbed target specific
194+ # post-build CMake target which has a custom command attached to it.
195+ add_custom_target (mbed-post-build ALL DEPENDS mbed-post-build -bin-${MBED_TARGET} )
194196 endif ()
195197endfunction ()
196198
Original file line number Diff line number Diff line change 66#
77macro (mbed_set_post_build_operation)
88
9- add_custom_target (mbed-post-build -bin-${mbed_target_name}
10- DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /${APP_TARGET} .bin
11- )
12-
13- # Ensures the application artefacts are created before manipulating them.
14- add_dependencies (mbed-post-build -bin-${mbed_target_name} ${APP_TARGET} )
9+ add_custom_target (mbed-post-build -bin-${mbed_target_name} )
1510
1611 add_custom_command (
17- OUTPUT
18- ${CMAKE_CURRENT_BINARY_DIR} / ${APP_TARGET} .bin
12+ TARGET
13+ mbed-post- build -bin- ${mbed_target_name}
1914 POST_BUILD
2015 COMMAND
2116 ${post_build_command}
You can’t perform that action at this time.
0 commit comments