Skip to content

Commit

Permalink
Make it easier to do different types of asan.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Oct 27, 2017
1 parent fd0cbe4 commit 7fa54d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7fa54d5

Please sign in to comment.