Permalink
Browse files

Make it easier to do different types of asan.

  • Loading branch information...
Andersbakken committed Oct 27, 2017
1 parent fd0cbe4 commit 7fa54d513fc716b2dc1055636b4728ab29dfdd3e
Showing with 9 additions and 5 deletions.
  1. +5 −4 CMakeLists.txt
  2. +4 −1 configure
View
@@ -15,10 +15,11 @@ else ()
endif ()
if (ASAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=leak")
string(REPLACE "," ";" ASANS ${ASAN})
foreach (SANITIZE ${ASANS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${SANITIZE}")
endforeach ()
endif ()
if (NOT CMAKE_BUILD_TYPE)
View
@@ -102,7 +102,10 @@ while [ -n "$1" ]; do
CMAKE_ARGS="${CMAKE_ARGS} -DRTAGS_NO_ELISP_BYTECOMPILE=1"
;;
--asan)
CMAKE_ARGS="${CMAKE_ARGS} -DASAN=1"
CMAKE_ARGS="${CMAKE_ARGS} -DASAN=address,undefined"
;;
--asan=*)
CMAKE_ARGS="${CMAKE_ARGS} -DASAN=`echo $1 | sed -e 's,--asan=,,'`"
;;
--elisp-install-location)
shift

0 comments on commit 7fa54d5

Please sign in to comment.