From f697530574dc8b9bb89abf444d528587a4bd4196 Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Mon, 23 May 2022 14:35:44 +0100 Subject: [PATCH] Sanitizers: Fix logic setting up memory sanitizer --- cmake/Sanitizers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Sanitizers.cmake b/cmake/Sanitizers.cmake index f6d658cf0..b7e02c2ff 100644 --- a/cmake/Sanitizers.cmake +++ b/cmake/Sanitizers.cmake @@ -27,7 +27,7 @@ function(enable_sanitizers project_name) endif() option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" OFF) - if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(ENABLE_SANITIZER_MEMORY AND (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")) message(WARNING "Memory sanitizer requires all the code (including libc++) to be MSan-instrumented otherwise it reports false positives") if("address" IN_LIST SANITIZERS OR "thread" IN_LIST SANITIZERS