check_cxx_compiler_flag(-fsanitize=address HAVE_ASAN)
cmake_pop_check_state()
if(HAVE_ASAN)
+ add_compile_definitions(HAVE_ASAN)
add_compile_options(-fsanitize=address)
- add_link_options(-lasan)
+ link_libraries(asan)
+ check_flag(-fsanitize-recover=address IGNORE)
endif()
endif()
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)
- add_link_options(-lubsan)
+ link_libraries(ubsan)
+ check_flag(-fsanitize-recover=undefined IGNORE)
endif()
endif()
endif()