cmake: Og for debug build + extra debug information (ggdb3)

GSdx is utterly slow on debug build. -Og enable a couple of debugger-friendly optimization.
This commit is contained in:
Gregory Hainaut 2016-02-21 15:57:28 +01:00
parent 1e018d8a8a
commit 8987ca61a1
1 changed files with 8 additions and 4 deletions

View File

@ -254,9 +254,9 @@ if (USE_CLANG)
if (NOT APPLE) if (NOT APPLE)
set(COMMON_FLAG "${COMMON_FLAG} -no-integrated-as") set(COMMON_FLAG "${COMMON_FLAG} -no-integrated-as")
endif() endif()
set(DBG "-g") set(DBG "-g -fno-omit-frame-pointer")
else() else()
set(DBG "-ggdb") set(DBG "-ggdb3 -fno-omit-frame-pointer")
endif() endif()
if (USE_LTO) if (USE_LTO)
@ -280,14 +280,18 @@ elseif(CMAKE_BUILD_TYPE MATCHES "Release")
endif() endif()
if (USE_ASAN) if (USE_ASAN)
set(ASAN_FLAG "-fsanitize=address -fno-omit-frame-pointer ${DBG} -DASAN_WORKAROUND") set(ASAN_FLAG "-fsanitize=address ${DBG} -DASAN_WORKAROUND")
else() else()
set(ASAN_FLAG "") set(ASAN_FLAG "")
endif() endif()
if(NOT DEFINED OPTIMIZATION_FLAG) if(NOT DEFINED OPTIMIZATION_FLAG)
if (CMAKE_BUILD_TYPE STREQUAL Debug) if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(OPTIMIZATION_FLAG -O0) if (USE_CLANG)
set(OPTIMIZATION_FLAG -O0)
else()
set(OPTIMIZATION_FLAG -Og)
endif()
else() else()
set(OPTIMIZATION_FLAG -O2) set(OPTIMIZATION_FLAG -O2)
endif() endif()