CMake: Also add -g1/-gline-tables-only to linker options

This commit is contained in:
Jonathan G Rennison
2023-02-20 20:11:17 +00:00
parent 968709735d
commit 5efe3a8b5b

View File

@@ -69,8 +69,10 @@ macro(test_compile_libbfd var libs)
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(-gline-tables-only)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -gline-tables-only")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-g1)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g1")
endif ()
endif ()
endif ()