Fix sanitizer build (#3869)
This commit is contained in:
parent
2e09cd653a
commit
cc9c480554
@ -4,6 +4,14 @@
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if (ENABLE_SANITIZER OR ENABLE_THREAD_SANITIZER)
|
||||
# This is workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/16609.
|
||||
# It ensures pthread is searched without ASAN linking.
|
||||
# Line bellow must be before adding -fsanitize=address or -fsanitize=thread to
|
||||
# build options for the trick to work.
|
||||
find_package(Threads REQUIRED)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SANITIZER)
|
||||
set(SANITIZER_COMPILER_FLAGS "-g -fsanitize=address -fno-omit-frame-pointer")
|
||||
CHECK_CXX_COMPILER_FLAG("-fsanitize-recover=address" SANITIZE_RECOVER_SUPPORTED)
|
||||
|
Loading…
Reference in New Issue
Block a user