mirror of https://github.com/mamba-org/mamba.git
maint: Add missing thread and undefined sanitizers CMake options (#3753)
This commit is contained in:
parent
6d40f1d32e
commit
c59969ab05
|
@ -80,30 +80,35 @@ if(WIN32)
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(ENABLE_ASAN "Enable Address-Sanitizer (currently only supported on GCC and Clang)" OFF)
|
option(ENABLE_ASAN "Enable AddressSanitizer (currently only supported on GCC and Clang)" OFF)
|
||||||
|
|
||||||
if(ENABLE_ASAN)
|
if(ENABLE_ASAN)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"Address-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
|
"AddressSanitizer instrumentation will be injected into binaries - do not release these binaries"
|
||||||
)
|
)
|
||||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=address)
|
add_compile_options(-fno-omit-frame-pointer -fsanitize=address)
|
||||||
add_link_options(-fno-omit-frame-pointer -fsanitize=address)
|
add_link_options(-fno-omit-frame-pointer -fsanitize=address)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(ENABLE_TSAN "Enable ThreadSanitizer (currently only supported on GCC and Clang)" OFF)
|
||||||
if(ENABLE_TSAN)
|
if(ENABLE_TSAN)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"Thread-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
|
"ThreadSanitizer instrumentation will be injected into binaries - do not release these binaries"
|
||||||
)
|
)
|
||||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=thread)
|
add_compile_options(-fno-omit-frame-pointer -fsanitize=thread)
|
||||||
add_link_options(-fno-omit-frame-pointer -fsanitize=thread)
|
add_link_options(-fno-omit-frame-pointer -fsanitize=thread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_USAN)
|
option(
|
||||||
|
ENABLE_UBSAN
|
||||||
|
"Enable UndefinedBehaviorSanitizer (currently only supported on GCC and Clang)"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
if(ENABLE_UBSAN)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"Undefined-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
|
"UndefinedBehaviorSanitizer instrumentation will be injected into binaries - do not release these binaries"
|
||||||
)
|
)
|
||||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=undefined)
|
add_compile_options(-fno-omit-frame-pointer -fsanitize=undefined)
|
||||||
add_link_options(-fno-omit-frame-pointer -fsanitize=undefined)
|
add_link_options(-fno-omit-frame-pointer -fsanitize=undefined)
|
||||||
|
|
Loading…
Reference in New Issue