Fix cmake clang build for sanitizers

This commit is contained in:
Mike Ellery
2018-01-08 13:47:41 -08:00
committed by seelabs
parent ba43bfc646
commit 992a390d75

View File

@@ -530,11 +530,15 @@ macro(setup_build_boilerplate)
string(TOLOWER ${san} ci_san)
if (${ci_san} STREQUAL address)
set(SANITIZER_LIBRARIES asan)
if (is_gcc)
set(SANITIZER_LIBRARIES asan)
endif()
add_definitions(-DSANITIZER=ASAN)
endif()
if (${ci_san} STREQUAL thread)
set(SANITIZER_LIBRARIES tsan)
if (is_gcc)
set(SANITIZER_LIBRARIES tsan)
endif()
add_definitions(-DSANITIZER=TSAN)
endif()
endif()