From 92b860c8f4091407ae02ac71a1df5ff5613f37d2 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 16 Feb 2017 13:00:57 -0500 Subject: [PATCH] Added Address Sanitizer as a cmake option. This will help us figure out the crash. --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb1696d9..f4a01049 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,18 @@ else() -static-libstdc++ ) endif() + + # TODO document this + if(ADDRESS_SANITIZER) + set(_COMMON_CFLAGS ${_COMMON_CFLAGS} + -fsanitize=address + -fno-omit-frame-pointer + ) + set(_COMMON_LDFLAGS ${_COMMON_LDFLAGS} + -fsanitize=address + -fno-omit-frame-pointer + ) + endif() endif() # problem: