Skip to content

Commit f5897a8

Browse files
committed
fix: enable sanitzers for dynamic_project_options
1 parent 9be7709 commit f5897a8

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/DynamicProjectOptions.cmake

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,6 @@ macro(dynamic_project_options)
103103
)
104104
endif()
105105

106-
check_sanitizers_support(
107-
ENABLE_SANITIZER_ADDRESS
108-
ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
109-
ENABLE_SANITIZER_LEAK
110-
ENABLE_SANITIZER_THREAD
111-
ENABLE_SANITIZER_MEMORY
112-
ENABLE_SANITIZER_POINTER_COMPARE
113-
ENABLE_SANITIZER_POINTER_SUBTRACT
114-
)
115-
116-
if(ENABLE_SANITIZER_ADDRESS)
117-
set(SUPPORTS_ASAN ON)
118-
else()
119-
set(SUPPORTS_ASAN OFF)
120-
endif()
121-
122-
if(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR)
123-
set(SUPPORTS_UBSAN ON)
124-
else()
125-
set(SUPPORTS_UBSAN OFF)
126-
endif()
127-
128106
# ccache, clang-tidy, cppcheck are only supported with Ninja and Makefile based generators
129107
# note that it is possible to use Ninja with cl, so this still allows clang-tidy on Windows
130108
# with CL.
@@ -163,9 +141,9 @@ macro(dynamic_project_options)
163141
"0\;DISABLE_RTTI\;OFF\;OFF\;Disable RTTI (no-rtti flag)"
164142
"0\;ENABLE_BUILD_WITH_TIME_TRACE\;OFF\;OFF\;Generates report of where compile-time is spent"
165143
"0\;ENABLE_UNITY\;OFF\;OFF\;Merge C++ files into larger C++ files, can speed up compilation sometimes"
166-
"0\;ENABLE_SANITIZER_ADDRESS\;OFF\;${SUPPORTS_ASAN}\;Make memory errors into hard runtime errors (windows/linux/macos)"
144+
"0\;ENABLE_SANITIZER_ADDRESS\;OFF\;ON\;Make memory errors into hard runtime errors (windows/linux/macos)"
167145
"0\;ENABLE_SANITIZER_LEAK\;OFF\;OFF\;Make memory leaks into hard runtime errors"
168-
"0\;ENABLE_SANITIZER_UNDEFINED_BEHAVIOR\;OFF\;${SUPPORTS_UBSAN}\;Make certain types (numeric mostly) of undefined behavior into runtime errors"
146+
"0\;ENABLE_SANITIZER_UNDEFINED_BEHAVIOR\;OFF\;ON\;Make certain types (numeric mostly) of undefined behavior into runtime errors"
169147
"0\;ENABLE_SANITIZER_THREAD\;OFF\;OFF\;Make thread race conditions into hard runtime errors"
170148
"0\;ENABLE_SANITIZER_MEMORY\;OFF\;OFF\;Make other memory errors into runtime errors"
171149
"0\;ENABLE_CONTROL_FLOW_PROTECTION\;OFF\;OFF\;Enable control flow protection instrumentation"

0 commit comments

Comments
 (0)