From 36ebfdf33f445f50e2ff1213d795a094d08ef65c Mon Sep 17 00:00:00 2001 From: "Christian W. Zuckschwerdt" Date: Wed, 13 Mar 2019 11:57:42 +0000 Subject: [PATCH] Add ASAN to Debug builds --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e5bbccc..5f2ae454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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