Skip to content

Commit

Permalink
address sanitizer: support continue-after-error
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolberg committed May 7, 2022
1 parent 06dffd3 commit 28fdeb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ message(STATUS "Build with address sanitizer: ${ACL_WITH_ASAN}")
if(ACL_WITH_ASAN)
foreach(lang C CXX)
if(CMAKE_${lang}_COMPILER_ID MATCHES "^(Clang|GNU)$")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
# To continue after error, set environment variable ASAN_OPTIONS=halt_on_error=0
# https://github.com/google/sanitizers/wiki/AddressSanitizer#faq
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer")
else()
message(FATAL_ERROR "cannot build with address sanitizer due to unsupported ${lang} compiler")
endif()
Expand Down

0 comments on commit 28fdeb3

Please # to comment.