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)
5858 COMMAND ${Python3_EXECUTABLE} ${mbed-os_SOURCE_DIR}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map
5959 WORKING_DIRECTORY
6060 ${CMAKE_CURRENT_BINARY_DIR}
61- COMMENT
62- "Displaying memory map for ${target} "
6361)
6462endfunction ()
6563
@@ -87,6 +85,18 @@ function(mbed_set_post_build target)
8785 # The mapfile name includes the top-level target name and the
8886 # executable suffix for all toolchains as CMake hardcodes the name of the
8987 # 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+
90100 mbed_configure_memory_map(${target} "${CMAKE_CURRENT_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map" )
91101 mbed_validate_application_profile(${target} )
92102 mbed_generate_bin_hex(${target} )
You can’t perform that action at this time.
0 commit comments