Skip to content

Commit

Permalink
Add ENABLE_ASAN option to enable ASAN builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Jun 27, 2024
1 parent bfcee23 commit 0f54cfd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" OFF)
option(ENABLE_MATPLOTLIB "Enable matplotlib library in experiments" OFF)
option(ENABLE_NAUTY "Enable the Nauty library for percy" OFF)
option(ENABLE_ABC "Enable linking ABC as a static library" OFF)
option(ENABLE_ASAN, "Enable ASAN sanitizer" OFF)

if(UNIX)
# show quite some warnings (but remove some intentionally)
Expand All @@ -28,6 +29,10 @@ if(UNIX)
if (ENABLE_COVERAGE)
add_compile_options(-O0 -g --coverage -fprofile-arcs -ftest-coverage)
endif()
if (ENABLE_ASAN)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
add_link_options(-fsanitize=address)
endif()
endif()
if(MSVC)
add_compile_options(/EHsc /bigobj)
Expand Down

0 comments on commit 0f54cfd

Please sign in to comment.