mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(cmakev2): add --cref with MAPFILE_TARGET and remove global -Wl,--cref
When MAPFILE_TARGET is used in idf_build_executable, add the linker --cref option so the cross-reference table is written to the map file instead of stdout. Remove the global -Wl,--cref from default link options in project.cmake so cref is only applied where a map file is requested.
This commit is contained in:
@@ -597,6 +597,8 @@ function(idf_build_executable executable)
|
||||
if(ARG_MAPFILE_TARGET AND "${linker_type}" STREQUAL "GNU")
|
||||
set(mapfile "${CMAKE_BINARY_DIR}/${ARG_NAME}.map")
|
||||
target_link_options(${executable} PRIVATE "LINKER:--Map=${mapfile}")
|
||||
# Add cross-reference table to the map file
|
||||
target_link_options(${executable} PRIVATE "LINKER:--cref")
|
||||
add_custom_command(
|
||||
OUTPUT "${mapfile}"
|
||||
DEPENDS ${executable}
|
||||
|
||||
Reference in New Issue
Block a user