From 7177fa5a6353284ba16bff5a80ff3b11d3b02a2d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 25 Jan 2012 11:14:17 +0000 Subject: [PATCH] Add a check that NDEBUG is not defined by test platforms --- Installation/cmake/modules/CGAL_SetupFlags.cmake | 4 ++++ Installation/include/CGAL/config.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Installation/cmake/modules/CGAL_SetupFlags.cmake b/Installation/cmake/modules/CGAL_SetupFlags.cmake index 88798bba88f..7393f446139 100644 --- a/Installation/cmake/modules/CGAL_SetupFlags.cmake +++ b/Installation/cmake/modules/CGAL_SetupFlags.cmake @@ -57,6 +57,10 @@ if ( NOT CMAKE_BUILD_TYPE ) endif() endif() +if( RUNNING_CGAL_AUTO_TEST ) + add_definitions(-DCGAL_TEST_SUITE) +endif() + if ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" ) message( FATAL_ERROR "${CMAKE_BUILD_TYPE} is not a valid build type: only Release or Debug is allowed" ) endif() diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 4bae87ab6f5..1e592599bff 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -34,6 +34,10 @@ #include #endif +#if defined(CGAL_TEST_SUITE) && defined(NDEBUG) +# error The test-suite needs no NDEBUG defined +#endif // CGAL_TEST_SUITE and NDEBUG + // The following header file defines among other things BOOST_PREVENT_MACRO_SUBSTITUTION #include