|
@@ -11,25 +11,21 @@ endif()
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconsumed -Wno-overloaded-virtual")
|
|
|
|
|
|
- option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
|
|
|
if (ENABLE_ADDRESS_SANITIZER)
|
|
|
add_definitions(-fsanitize=address -fno-omit-frame-pointer)
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
|
|
endif()
|
|
|
|
|
|
- option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" FALSE)
|
|
|
if (ENABLE_MEMORY_SANITIZER)
|
|
|
add_definitions(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
|
|
|
endif()
|
|
|
|
|
|
- option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
|
|
|
if (ENABLE_UNDEFINED_SANITIZER)
|
|
|
add_definitions(-fsanitize=undefined -fno-omit-frame-pointer)
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined")
|
|
|
endif()
|
|
|
|
|
|
- option(ENABLE_FUZZER_SANITIZER "Enable fuzzer sanitizer testing in clang" FALSE)
|
|
|
if (ENABLE_FUZZER_SANITIZER)
|
|
|
add_definitions(-fsanitize=fuzzer -fno-omit-frame-pointer)
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer")
|