[CMAKE] Disable debugging related GCC flags in release mode.

svn path=/trunk/; revision=68148
This commit is contained in:
Amine Khaldi 2015-06-15 17:26:04 +00:00
parent 74c80a51dd
commit 983d1bf043

View file

@ -87,13 +87,15 @@ if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT SEPARATE_DBG))
endif() endif()
# Debugging # Debugging
if(SEPARATE_DBG) if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
if(SEPARATE_DBG)
add_compile_flags("-gdwarf-2 -ggdb") add_compile_flags("-gdwarf-2 -ggdb")
else() else()
add_compile_flags("-gdwarf-2 -gstrict-dwarf") add_compile_flags("-gdwarf-2 -gstrict-dwarf")
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols")
endif() endif()
endif()
endif() endif()
# For some reason, cmake sets -fPIC, and we don't want it # For some reason, cmake sets -fPIC, and we don't want it