- if(undefined IN_LIST ENABLE_SANITIZERS OR ubsan IN_LIST ENABLE_SANITIZERS)
- cmake_push_check_state(RESET)
- set(CMAKE_REQUIRED_LIBRARIES ubsan)
- check_cxx_compiler_flag(-fsanitize=undefined HAVE_UBSAN)
- cmake_pop_check_state()
- if(HAVE_UBSAN)
- add_compile_definitions(HAVE_UBSAN)
- add_compile_options(-fsanitize=undefined)
- link_libraries(-fsanitize=undefined)
- check_flag(-fsanitize-recover=undefined IGNORE)
+ if(undefined IN_LIST ENABLE_SANITIZERS OR ubsan IN_LIST ENABLE_SANITIZERS)
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_LIBRARIES ubsan)
+ check_cxx_compiler_flag(-fsanitize=undefined HAVE_UBSAN)
+ cmake_pop_check_state()
+ if(HAVE_UBSAN)
+ add_compile_definitions(HAVE_UBSAN)
+ add_compile_options(-fsanitize=undefined)
+ link_libraries(-fsanitize=undefined)
+ check_flag(-fsanitize-recover=undefined IGNORE)
+ endif()