diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 599c66963a7..64b0d33562b 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -87,12 +87,14 @@ if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT SEPARATE_DBG)) endif() # Debugging -if(SEPARATE_DBG) - add_compile_flags("-gdwarf-2 -ggdb") -else() - add_compile_flags("-gdwarf-2 -gstrict-dwarf") - if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") +if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") + if(SEPARATE_DBG) + add_compile_flags("-gdwarf-2 -ggdb") + else() + add_compile_flags("-gdwarf-2 -gstrict-dwarf") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") + endif() endif() endif()