diff --git a/CMakeLists.txt b/CMakeLists.txt index d433a0ec9..340e8a64d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ if (WIN32) find_package(WinToast REQUIRED) endif () -find_package(Sanitizers) +find_package(Sanitizers QUIET) # Find boost on the system # `OPTIONAL_COMPONENTS random` is required for vcpkg builds to link. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 465a147f1..b7465ebdb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -710,7 +710,12 @@ if (BUILD_APP) else() add_executable(${EXECUTABLE_PROJECT} main.cpp) endif() - add_sanitizers(${EXECUTABLE_PROJECT}) + + if(COMMAND add_sanitizers) + add_sanitizers(${EXECUTABLE_PROJECT}) + else() + message(WARNING "Sanitizers support is disabled") + endif() target_include_directories(${EXECUTABLE_PROJECT} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/autogen/)