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 @@ -182,6 +182,14 @@ if (LINUX)
182
182
-lm
183
183
)
184
184
endif ()
185
+
186
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
187
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
188
+ add_compile_options (--analyze)
189
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
190
+ add_compile_options (-fanalyzer)
191
+ endif ()
192
+ endif ()
185
193
endif (LINUX)
186
194
187
195
if (DARWIN)
@@ -203,6 +211,10 @@ if (DARWIN)
203
211
# required for clang-15/xcode-15 since our boost package still uses deprecated std::unary_function/binary_function
204
212
# see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#C++-Standard-Library
205
213
add_compile_definitions (_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
214
+
215
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
216
+ add_compile_options (--analyze)
217
+ endif ()
206
218
endif (DARWIN)
207
219
208
220
if (LINUX OR DARWIN)
@@ -218,4 +230,8 @@ if(LINUX OR DARWIN)
218
230
219
231
add_compile_options (${GCC_WARNINGS} )
220
232
add_compile_options (-m${ADDRESS_SIZE} )
233
+
234
+ if (CMAKE_BUILD_TYPE MATCHES "^RelWithDebInfo(OS)?$" )
235
+ add_compile_options (-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=bounds)
236
+ endif ()
221
237
endif (LINUX OR DARWIN)
You can’t perform that action at this time.
0 commit comments