Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maint: Add missing thread and undefined sanitizers CMake options #3753

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,35 @@ if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
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)
message(
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_link_options(-fno-omit-frame-pointer -fsanitize=address)
endif()

option(ENABLE_TSAN "Enable ThreadSanitizer (currently only supported on GCC and Clang)" OFF)
if(ENABLE_TSAN)
message(
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_link_options(-fno-omit-frame-pointer -fsanitize=thread)
endif()

if(ENABLE_USAN)
option(
ENABLE_UBSAN
"Enable UndefinedBehaviorSanitizer (currently only supported on GCC and Clang)"
OFF
)
if(ENABLE_UBSAN)
message(
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_link_options(-fno-omit-frame-pointer -fsanitize=undefined)
Expand Down
Loading