pluginprocess-improvements: fix asan/ubsan on clang/linux
@@ -125,8 +125,11 @@ if (ENABLE_ASAN)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=integer")
set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize-blacklist=\"${CMAKE_SOURCE_DIR}/tests/sanitizer.blacklist\"")
- # on some systems clang does not link the asan/ubsan libraries, so enforce it
+
+ # in case the ubsan library exists, link it otherwise some tests will fail due to missing symbols on unix
+ if (UNIX AND NOT APPLE)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lubsan")
+ endif (UNIX AND NOT APPLE)
endif ()
if (CMAKE_COMPILER_IS_GNUCXX)
