MaxScale/cmake/FindASAN.cmake
Markus Mäkelä fb9b027842 Enable optional use of ASAN
AdressSanitizer is a lightweight memory error detector that instruments at
compile time instead of at execution time. This allows serious memory
errors to be detected without the cost of slowing down the whole program
that often happens when Valgrind is used. It is also easier to enable for
test runs as it is a simple compiler flag.
2017-08-17 15:02:16 +03:00

15 lines
437 B
CMake

# Find AddressSanitizer libraries
#
# The following variables are set:
# ASAN_FOUND - If AddressSanitizer was found
# ASAN_LIBRARIES - Path to the libasan library
find_library(ASAN_LIBRARIES NAMES libasan.so.0 libasan.so.3 libasan.so.4)
if (ASAN_LIBRARIES)
message(STATUS "Found AdressSanitizer libraries: ${ASAN_LIBRARIES}")
set(ASAN_FOUND TRUE CACHE INTERNAL "")
else()
message(STATUS "Could not find AdressSanitizer")
endif()