From 1265abd4a0d7bc80f238e6f6f5884b23d8b9b1d8 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 7 Jan 2014 02:04:31 +0000 Subject: [PATCH] Remove definition of NDEBUG for VS (since VS will define this automatically in release builds), and add -DDEBUG in VS only for debug builds. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14956 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21ad7580d..3aeb6cdf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,17 +149,22 @@ if(WIN32) # And shut up about unsafe stuff add_definitions(-D_CRT_SECURE_NO_WARNINGS) + # VS will automatically add NDEBUG for release mode, but only _DEBUG in debug mode. + # Since STK uses DEBUG, this is added for debug compilation only: + set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG) +else() + # All non VS generators used create only a single compile mode, so + # compile flags can be simplye be added + if(CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions(-DDEBUG) + else() + add_definitions(-DNDEBUG) + endif() endif() # TODO: remove this switch add_definitions(-DHAVE_OGGVORBIS) -if(CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-DDEBUG) -else() - add_definitions(-DNDEBUG) -endif() - # Provides list of source and header files (STK_SOURCES and STK_HEADERS) include(sources.cmake)