File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,14 @@ if (LINUX)
176
176
-lm
177
177
)
178
178
endif ()
179
+
180
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
181
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
182
+ add_compile_options (--analyze)
183
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
184
+ add_compile_options (-fanalyzer)
185
+ endif ()
186
+ endif ()
179
187
endif (LINUX)
180
188
181
189
if (DARWIN)
@@ -199,6 +207,10 @@ if (DARWIN)
199
207
# required for clang-15/xcode-15 since our boost package still uses deprecated std::unary_function/binary_function
200
208
# see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#C++-Standard-Library
201
209
add_compile_definitions (_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
210
+
211
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
212
+ add_compile_options (--analyze)
213
+ endif ()
202
214
endif (DARWIN)
203
215
204
216
if (LINUX OR DARWIN)
@@ -214,4 +226,8 @@ if(LINUX OR DARWIN)
214
226
215
227
add_compile_options (${GCC_WARNINGS} )
216
228
add_compile_options (-m${ADDRESS_SIZE} )
229
+
230
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
231
+ add_compile_options (-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=bounds)
232
+ endif ()
217
233
endif (LINUX OR DARWIN)
You can’t perform that action at this time.
0 commit comments