Skip to content

Commit 70b2193

Browse files
committed
copy map file to .old before creating new one
1 parent d93843a commit 70b2193

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/cmake/mbed_set_post_build.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ function(mbed_set_post_build target)
8787
# The mapfile name includes the top-level target name and the
8888
# executable suffix for all toolchains as CMake hardcodes the name of the
8989
# diagnostic output file for some toolchains.
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)
9096
mbed_configure_memory_map(${target} "${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map")
9197
mbed_validate_application_profile(${target})
9298
mbed_generate_bin_hex(${target})

0 commit comments

Comments
 (0)