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

Ian Romanick idr at freedesktop.org
Tue Nov 15 17:28:37 PST 2011


On 11/15/2011 01:34 PM, nobled wrote:
> 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)

Dear God, yes!  Though I talked to Chad, and he wasn't sure if this 
would work.  He was going to test it after getting home and reply to the 
patch.

Acked-by: Ian Romanick <ian.d.romanick at intel.com>


More information about the Piglit mailing list