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)
186
186
)
187
187
188
188
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} )
194
196
endif ()
195
197
endfunction ()
196
198
Original file line number Diff line number Diff line change 6
6
#
7
7
macro (mbed_set_post_build_operation )
8
8
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} )
15
10
16
11
add_custom_command (
17
- OUTPUT
18
- ${CMAKE_CURRENT_BINARY_DIR} /${APP_TARGET}.bin
12
+ TARGET
13
+ mbed-post-build-bin-${mbed_target_name}
19
14
POST_BUILD
20
15
COMMAND
21
16
${post_build_command}
You can’t perform that action at this time.
0 commit comments