mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 16:50:05 +00:00
[build] add cmake option for generating .map files (#9006)
This adds the CMake option `OT_LINKER_MAP` which will generate `.map` files for any executables built when the option is `ON`.
This commit is contained in:
@@ -48,5 +48,13 @@ target_link_libraries(ot-cli-ftd PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
if(OT_LINKER_MAP)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
|
||||
target_link_libraries(ot-cli-ftd PRIVATE -Wl,-map,ot-cli-ftd.map)
|
||||
else()
|
||||
target_link_libraries(ot-cli-ftd PRIVATE -Wl,-Map=ot-cli-ftd.map)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS ot-cli-ftd
|
||||
DESTINATION bin)
|
||||
|
||||
@@ -48,5 +48,13 @@ target_link_libraries(ot-cli-mtd PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
if(OT_LINKER_MAP)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
|
||||
target_link_libraries(ot-cli-mtd PRIVATE -Wl,-map,ot-cli-mtd.map)
|
||||
else()
|
||||
target_link_libraries(ot-cli-mtd PRIVATE -Wl,-Map=ot-cli-mtd.map)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS ot-cli-mtd
|
||||
DESTINATION bin)
|
||||
|
||||
@@ -52,6 +52,14 @@ target_link_libraries(ot-cli-radio PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
if(OT_LINKER_MAP)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
|
||||
target_link_libraries(ot-cli-radio PRIVATE -Wl,-map,ot-cli-radio.map)
|
||||
else()
|
||||
target_link_libraries(ot-cli-radio PRIVATE -Wl,-Map=ot-cli-radio.map)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS ot-cli-radio
|
||||
DESTINATION bin
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user