summaryrefslogtreecommitdiff
path: root/backend/CMakeLists.txt
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-02-22 16:39:36 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:15:25 -0700
commite6b3be81e6004d38b8025caa7db100024b20699c (patch)
treef5b21ef617f732280b91a002d8786365debb9fca /backend/CMakeLists.txt
parent7d822e7e330be8ab120fe2c7230a83e327f3d102 (diff)
Added a new define for the debug mode (GBE_DEBUG)
Diffstat (limited to 'backend/CMakeLists.txt')
-rw-r--r--backend/CMakeLists.txt33
1 files changed, 19 insertions, 14 deletions
diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt
index d235af99..cea4e588 100644
--- a/backend/CMakeLists.txt
+++ b/backend/CMakeLists.txt
@@ -60,23 +60,26 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (NOT GBE_COMPILE_UTESTS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
endif (NOT GBE_COMPILE_UTESTS)
- set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -ftree-vectorize")
+ set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")
+ set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DGBE_DEBUG=0")
elseif (COMPILER STREQUAL "CLANG")
set (CMAKE_C_COMPILER "clang")
set (CMAKE_C_FLAGS "-Wall -std=c99")
- set (CMAKE_C_FLAGS_DEBUG "-g")
- set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
- set (CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
- set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
+ set (CMAKE_C_FLAGS_DEBUG "-g -DGBE_DEBUG=1")
+ set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
+ set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")
+ set (CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG -DGBE_DEBUG=0")
set (CMAKE_CXX_COMPILER "clang++")
set (CMAKE_CXX_FLAGS "-fstrict-aliasing -msse2 -ffast-math -fPIC -Wall -Wno-format-security -Wno-invalid-offsetof -std=c++0x")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG}")
- set (CMAKE_CXX_FLAGS_DEBUG "-g")
- set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+ set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")
+ set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DGBE_DEBUG=0")
set (CMAKE_AR "/usr/bin/llvm-ar")
set (CMAKE_LINKER "/usr/bin/llvm-ld")
set (CMAKE_NM "/usr/bin/llvm-nm")
@@ -89,10 +92,11 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG} -Wl,-E")
- set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
- set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2")
- set (CCMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2")
- set (CCMAKE_CXX_FLAGS_MINSIZEREL "-Os")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MODE_FLAG}")
+ set (CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DGBE_DEBUG=1")
+ set (CCMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DGBE_DEBUG=1")
+ set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2 -DGBE_DEBUG=0")
+ set (CCMAKE_CXX_FLAGS_MINSIZEREL "-Os -DGBE_DEBUG=0")
set (CMAKE_EXE_LINKER_FLAGS "")
endif ()
@@ -102,7 +106,8 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -fstrict-aliasing -msse2 -ffast-math -Wall -fno-rtti -std=c++0x")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
- set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MODE_FLAG}")
+ set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0")
else (MINGW)
set (COMMON_FLAGS "${GBE_DEBUG_MEMORY_FLAG} /arch:SSE2 /D_CRT_SECURE_NO_WARNINGS /DNOMINMAX /GR- /GS- /W3 /wd4275")
set (CMAKE_CXX_FLAGS ${COMMON_FLAGS})