Skip to content

Commit

Permalink
Add ASAN option
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroMemes committed Sep 30, 2024
1 parent c97f256 commit 7a20846
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(LIBHAT_INSTALL_TARGET "Creates install rules for the libhat target" ON)
option(LIBHAT_DISABLE_SSE "Disables SSE scanning" OFF)
option(LIBHAT_DISABLE_AVX512 "Disables AVX512 scanning" OFF)
option(LIBHAT_TESTING "Enable tests" OFF)
option(LIBHAT_TESTING_ASAN "Enable address sanitizer when testing" ON)
option(LIBHAT_TESTING_SDE "Run tests using Intel Software Development Emulator" ON)

option(LIBHAT_HINT_X86_64 "Enables support for the x86_64 scan hint, requires a small (less than 1KB) data table" ON)
Expand All @@ -26,6 +27,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set_source_files_properties(src/arch/x86/System.cpp PROPERTIES COMPILE_FLAGS "-mxsave")
endif()

if(LIBHAT_TESTING AND LIBHAT_TESTING_ASAN)
if(MSVC)
add_compile_options($<$<CONFIG:Debug>:/fsanitize=address>)
endif()
# TODO: Linux
endif()

set(LIBHAT_SRC
src/Scanner.cpp
src/System.cpp
Expand Down

0 comments on commit 7a20846

Please sign in to comment.