mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
cmake: fix the map file not generated when compiling with Clang
When compiling for a chip target with Clang, CMAKE_C_COMPILER_ID="Clang" but the linker is still a GNU linker. Therefore we can still generate the map file.
This commit is contained in:
@@ -512,6 +512,15 @@ macro(project project_name)
|
|||||||
list(REMOVE_ITEM build_components ${test_components})
|
list(REMOVE_ITEM build_components ${test_components})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
# Compiling for the host, and the host is macOS, so the linker is Darwin LD.
|
||||||
|
# Note, when adding support for Clang and LLD based toolchain this check will
|
||||||
|
# need to be modified.
|
||||||
|
set(linker_type "Darwin")
|
||||||
|
else()
|
||||||
|
set(linker_type "GNU")
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(build_component ${build_components})
|
foreach(build_component ${build_components})
|
||||||
__component_get_target(build_component_target ${build_component})
|
__component_get_target(build_component_target ${build_component})
|
||||||
__component_get_property(whole_archive ${build_component_target} WHOLE_ARCHIVE)
|
__component_get_property(whole_archive ${build_component_target} WHOLE_ARCHIVE)
|
||||||
@@ -534,7 +543,7 @@ macro(project project_name)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
if(linker_type STREQUAL "GNU")
|
||||||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
||||||
set(idf_target "${IDF_TARGET}")
|
set(idf_target "${IDF_TARGET}")
|
||||||
string(TOUPPER ${idf_target} idf_target)
|
string(TOUPPER ${idf_target} idf_target)
|
||||||
|
Reference in New Issue
Block a user