CMake: Enable debug line tables if BFD found

pull/167/head
Jonathan G Rennison 4 years ago
parent 22c3a01069
commit fa42151290

@ -65,6 +65,16 @@ macro(test_compile_libbfd var libs)
link_libraries(${libs})
endif ()
if (BFD_FOUND)
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)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-g1)
endif ()
endif ()
endif ()
set(CMAKE_REQUIRED_LIBRARIES "")
endmacro()

Loading…
Cancel
Save