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