Enable use of TSAN
The -DWITH_TSAN option enables the ThreadSanitizer if libtsan is installed.
This commit is contained in:
@ -7,8 +7,8 @@
|
||||
find_library(ASAN_LIBRARIES NAMES libasan.so.0 libasan.so.1 libasan.so.2 libasan.so.3 libasan.so.4)
|
||||
|
||||
if (ASAN_LIBRARIES)
|
||||
message(STATUS "Found AdressSanitizer libraries: ${ASAN_LIBRARIES}")
|
||||
message(STATUS "Found AddressSanitizer libraries: ${ASAN_LIBRARIES}")
|
||||
set(ASAN_FOUND TRUE CACHE INTERNAL "")
|
||||
else()
|
||||
message(STATUS "Could not find AdressSanitizer")
|
||||
message(STATUS "Could not find AddressSanitizer")
|
||||
endif()
|
||||
|
||||
14
cmake/FindTSAN.cmake
Normal file
14
cmake/FindTSAN.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
# Find ThreadSanitizer libraries
|
||||
#
|
||||
# The following variables are set:
|
||||
# TSAN_FOUND - If ThreadSanitizer was found
|
||||
# TSAN_LIBRARIES - Path to the libasan library
|
||||
|
||||
find_library(TSAN_LIBRARIES NAMES libtsan.so.0 libtsan.so.1 libtsan.so.2 libtsan.so.3 libtsan.so.4)
|
||||
|
||||
if (TSAN_LIBRARIES)
|
||||
message(STATUS "Found ThreadSanitizer libraries: ${TSAN_LIBRARIES}")
|
||||
set(TSAN_FOUND TRUE CACHE INTERNAL "")
|
||||
else()
|
||||
message(STATUS "Could not find AdressSanitizer")
|
||||
endif()
|
||||
Reference in New Issue
Block a user