Skip to content

Commit c59969a

Browse files
authored
maint: Add missing thread and undefined sanitizers CMake options (#3753)
1 parent 6d40f1d commit c59969a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

libmamba/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,35 @@ if(WIN32)
8080
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
8181
endif()
8282

83-
option(ENABLE_ASAN "Enable Address-Sanitizer (currently only supported on GCC and Clang)" OFF)
84-
83+
option(ENABLE_ASAN "Enable AddressSanitizer (currently only supported on GCC and Clang)" OFF)
8584
if(ENABLE_ASAN)
8685
message(
8786
WARNING
88-
"Address-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
87+
"AddressSanitizer instrumentation will be injected into binaries - do not release these binaries"
8988
)
9089
add_compile_options(-fno-omit-frame-pointer -fsanitize=address)
9190
add_link_options(-fno-omit-frame-pointer -fsanitize=address)
9291
endif()
9392

93+
option(ENABLE_TSAN "Enable ThreadSanitizer (currently only supported on GCC and Clang)" OFF)
9494
if(ENABLE_TSAN)
9595
message(
9696
WARNING
97-
"Thread-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
97+
"ThreadSanitizer instrumentation will be injected into binaries - do not release these binaries"
9898
)
9999
add_compile_options(-fno-omit-frame-pointer -fsanitize=thread)
100100
add_link_options(-fno-omit-frame-pointer -fsanitize=thread)
101101
endif()
102102

103-
if(ENABLE_USAN)
103+
option(
104+
ENABLE_UBSAN
105+
"Enable UndefinedBehaviorSanitizer (currently only supported on GCC and Clang)"
106+
OFF
107+
)
108+
if(ENABLE_UBSAN)
104109
message(
105110
WARNING
106-
"Undefined-Sanitizer instrumentation will be injected into binaries - do not release these binaries"
111+
"UndefinedBehaviorSanitizer instrumentation will be injected into binaries - do not release these binaries"
107112
)
108113
add_compile_options(-fno-omit-frame-pointer -fsanitize=undefined)
109114
add_link_options(-fno-omit-frame-pointer -fsanitize=undefined)

0 commit comments

Comments
 (0)