Skip to content

Commit

Permalink
added ASAN option
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Oct 21, 2024
1 parent ad69578 commit 73be9c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option (ENABLE_TESTS "Build tests" OFF)
option (ENABLE_EXAMPLES "Build examples" OFF)
option (ENABLE_BEDROCK "Build bedrock module" OFF)
option (ENABLE_COVERAGE "Build with coverage" OFF)
option (ENABLE_ASAN "Build with address sanitizer" OFF)

# add our cmake module directory to the path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
Expand Down Expand Up @@ -44,6 +45,12 @@ if (ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif ()
endif ()

if (ENABLE_ASAN)
set (CMAKE_BUILD_TYPE Debug)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
endif ()

find_package (PkgConfig REQUIRED)
# search fo thallium
find_package (thallium REQUIRED)
Expand Down

0 comments on commit 73be9c9

Please sign in to comment.