ASan: Fix setup on FreeBSD
@@ -141,10 +141,10 @@ if (ENABLE_ASAN)
set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=integer")
set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize-blacklist=\"${CMAKE_SOURCE_DIR}/tests/sanitizer.blacklist\"")
- # in case the ubsan library exists, link it otherwise some tests will fail due to missing symbols on unix
- if (UNIX AND NOT APPLE)
+ # In case the ubsan library exists, link it otherwise some tests will fail due to missing symbols on Linux
+ if (CMAKE_SYSTEM_NAME MATCHES Linux)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lubsan")
- endif (UNIX AND NOT APPLE)
+ endif (CMAKE_SYSTEM_NAME MATCHES Linux)
endif ()
if (CMAKE_COMPILER_IS_GNUCXX)
