Correctly define DEBUG macro

This commit is contained in:
derselbst 2019-08-02 13:21:21 +02:00
parent 44453ff232
commit ca7f7047ad

View file

@ -189,7 +189,7 @@ if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_
endif (CMAKE_C_COMPILER_ID STREQUAL "Intel" )
# prepend to build type specific flags, to allow users to override
set ( CMAKE_C_FLAGS_DEBUG "-g -DDEBUG -fsanitize=undefined ${CMAKE_C_FLAGS_DEBUG}" )
set ( CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}" )
endif ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "Intel" )
@ -385,10 +385,9 @@ if ( NOT CMAKE_BUILD_TYPE )
endif ( NOT CMAKE_BUILD_TYPE )
unset ( ENABLE_DEBUG CACHE )
unset ( DEBUG CACHE )
if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
set ( ENABLE_DEBUG 1 )
set ( DEBUG 1 )
add_definitions(-DDEBUG)
endif ( CMAKE_BUILD_TYPE MATCHES "Debug" )
# Additional targets to perform clang-format/clang-tidy