diff --git a/cmake/config.cmake b/cmake/config.cmake index d7293eac..cff24a58 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -47,6 +47,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(MOLD_LINKER) set(CMAKE_LINKER_TYPE "MOLD") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-eliminate-unused-debug-types") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-eliminate-unused-debug-types") + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-eliminate-unused-debug-types") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-eliminate-unused-debug-types") + endif() endif()