Skip to content

Commit

Permalink
Use -gdwarf-aranges for test targets with Clang
Browse files Browse the repository at this point in the history
Related: jrfonseca#42
  • Loading branch information
alvinhochun committed Apr 8, 2022
1 parent ceca669 commit 8b990e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ macro (force_debug)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-aranges")
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-aranges")
endif ()
foreach (build_type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
set (CMAKE_C_FLAGS_${build_type} "")
set (CMAKE_CXX_FLAGS_${build_type} "")
Expand Down

0 comments on commit 8b990e9

Please sign in to comment.