diff --git a/cmake/sanitizers.cmake b/cmake/sanitizers.cmake index d0726be15..d09e2b282 100644 --- a/cmake/sanitizers.cmake +++ b/cmake/sanitizers.cmake @@ -1,15 +1,15 @@ option(ENABLE_ADDRESS_SANITIZER OFF) -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") if (ENABLE_ADDRESS_SANITIZER) add_compile_options(-fsanitize=address) add_link_options(-fsanitize=address) - message(STATUS "Enabled clang address sanitizer") + message(STATUS "Enabled address sanitizer") endif() if (ENABLE_UB_SANITIZER) add_compile_options(-fsanitize=undefined) add_link_options(-fsanitize=undefined) - message(STATUS "Enabled clang UB sanitizer") + message(STATUS "Enabled UB sanitizer") endif() else() - message(WARNING "Sanitizers are supported on clang compiler only! Switch your compiler to clang to enable it") + message(WARNING "Sanitizers are supported on gcc and clang compilers only!") endif()