diff --git a/cmake/Backtrace.cmake b/cmake/Backtrace.cmake index 1434984f..ee862db5 100644 --- a/cmake/Backtrace.cmake +++ b/cmake/Backtrace.cmake @@ -29,7 +29,9 @@ if(HAVE_DLADDR) endif() if(HAVE_BACKTRACE OR HAVE_DLADDR) - target_compile_options(project_options INTERFACE -ggdb3) + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + target_compile_options(project_options INTERFACE -ggdb3) + endif() target_link_libraries(project_options INTERFACE -rdynamic) add_definitions(-D_GNU_SOURCE=1) endif()