Add ASAN to Debug builds

This commit is contained in:
Christian W. Zuckschwerdt
2019-03-13 11:57:42 +00:00
parent 64139f309e
commit 36ebfdf33f

View File

@@ -63,6 +63,8 @@ if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" MATCHES
# set(CMAKE_C_FLAGS_RELEASE -O2)
# CMake Debug default for GCC/Clang is "-g -DNDEBUG"
# set(CMAKE_C_FLAGS_DEBUG -g3 -O0)
# make use of ASAN
set(CMAKE_C_FLAGS_DEBUG "-ggdb -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer")
endif()
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
# make sure we don't accidentally copy more than an int