summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-10-22 12:25:55 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-10-22 12:26:56 +0200
commit4ce16ed82f658e242ffa91ce0abf98dfe45a04ad (patch)
treea4fc5c64f20c52c157b2e3667be0f8658534a74a /CMakeLists.txt
parent28c1451a7c863cb89d598c03d53c4e73497e4c83 (diff)
downloadlibgit2-4ce16ed82f658e242ffa91ce0abf98dfe45a04ad.tar.gz
CMake: use -O0 in debug mode
Otherwise, GCC optimizes variables away and gdb can't tell us what's in them. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba646b61f..7655e0ba5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,7 @@ IF (MSVC)
SET(WIN_RC "src/win32/git2.rc")
ELSE ()
SET(CMAKE_C_FLAGS "-O2 -g -Wall -Wextra -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes ${CMAKE_C_FLAGS}")
+ SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
IF (NOT MINGW) # MinGW always does PIC and complains if we tell it to
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
ENDIF ()