[Piglit] [PATCH] CMake: compile with debug info on by default

nobled nobled at dreamwidth.org
Tue Nov 15 13:34:45 PST 2011


This makes debugging crashes feasible out of the box.
---
 CMakeLists.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a97486..87a5668 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,10 @@ 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`):
+SET(CMAKE_BUILD_TYPE Debug CACHE STRING
+	"May be one of: None Debug RelWithDebInfo Release MinSizeRel" FORCE)
+
 if (NOT MSVC)
 	CHECK_C_COMPILER_FLAG("-Wall" C_COMPILER_FLAG_WALL)
 	IF (C_COMPILER_FLAG_WALL)
-- 
1.7.4.1


More information about the Piglit mailing list