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