File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -88,11 +88,20 @@ function(mbed_set_post_build target)
88
88
# executable suffix for all toolchains as CMake hardcodes the name of the
89
89
# diagnostic output file for some toolchains.
90
90
91
- # COPY_FILE could be used with cmake >=3.21
92
- file (COPY_FILE
93
- "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map"
94
- "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map.old"
95
- RESULT 0 )
91
+ # copy mapfile .map to .map.old for ram/rom statistics diff in memap.py
92
+ if (EXISTS ${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX}.map )
93
+ add_custom_command (
94
+ TARGET
95
+ ${target}
96
+ PRE_BUILD
97
+ COMMAND
98
+ ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map" "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map.old"
99
+ COMMENT
100
+ "executable:"
101
+ VERBATIM
102
+ )
103
+ endif ()
104
+
96
105
mbed_configure_memory_map (${target} "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map" )
97
106
mbed_validate_application_profile (${target} )
98
107
mbed_generate_bin_hex (${target} )
You can’t perform that action at this time.
0 commit comments