File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ function(mbed_generate_map_file target)
58
58
COMMAND ${Python3_EXECUTABLE} ${mbed-os_SOURCE_DIR}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX}.map
59
59
WORKING_DIRECTORY
60
60
${CMAKE_CURRENT_BINARY_DIR}
61
- COMMENT
62
- "Displaying memory map for ${target} "
63
61
)
64
62
endfunction ()
65
63
@@ -87,6 +85,18 @@ function(mbed_set_post_build target)
87
85
# The mapfile name includes the top-level target name and the
88
86
# executable suffix for all toolchains as CMake hardcodes the name of the
89
87
# diagnostic output file for some toolchains.
88
+
89
+ # copy mapfile .map to .map.old for ram/rom statistics diff in memap.py
90
+ if (EXISTS ${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX}.map )
91
+ add_custom_command (
92
+ TARGET
93
+ ${target}
94
+ PRE_BUILD
95
+ COMMAND
96
+ ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map" "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map.old"
97
+ )
98
+ endif ()
99
+
90
100
mbed_configure_memory_map (${target} "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map" )
91
101
mbed_validate_application_profile (${target} )
92
102
mbed_generate_bin_hex (${target} )
You can’t perform that action at this time.
0 commit comments