aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authornobled <nobled@dreamwidth.org>2011-11-15 20:22:07 +0000
committernobled <nobled@dreamwidth.org>2011-12-02 22:25:39 +0000
commit5a7e366f628ce49c10faa6a6f1d47e4e655b62af (patch)
treed23fdffed0e11b10b437ebcf9daf5b7ed624589a /CMakeLists.txt
parent92580461d93b0574e34a5a2baf0f13ba1a948f43 (diff)
downloadpiglit-5a7e366f628ce49c10faa6a6f1d47e4e655b62af.tar.gz
CMake: compile with debug info on by default
This makes debugging crashes feasible out of the box. Acked-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4052e22..179340e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,12 @@ if(NOT import_numpy_error_code EQUAL 0)
message(FATAL_ERROR "numpy library not found")
endif(NOT import_numpy_error_code EQUAL 0)
+# Default to compiling with debug information (`gcc -g`):
+if(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE Debug CACHE STRING
+ "May be one of: None Debug RelWithDebInfo Release MinSizeRel" FORCE)
+endif(NOT CMAKE_BUILD_TYPE)
+
if (NOT MSVC)
CHECK_C_COMPILER_FLAG("-Wall" C_COMPILER_FLAG_WALL)
IF (C_COMPILER_FLAG_WALL)