Add support for clang/gcc MemorySanitizer
This commit is contained in:
parent
5daf837037
commit
f4f2391801
@ -36,6 +36,12 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|||||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" FALSE)
|
||||||
|
if(ENABLE_MEMORY_SANITIZER)
|
||||||
|
add_definitions(-fsanitize=memory -g)
|
||||||
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
|
option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
|
||||||
if(ENABLE_UNDEFINED_SANITIZER)
|
if(ENABLE_UNDEFINED_SANITIZER)
|
||||||
add_definitions(-fsanitize=undefined -g)
|
add_definitions(-fsanitize=undefined -g)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user