From f274c503e1630739e9619aa72ca08735d01ffc1c Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Mon, 10 Sep 2018 23:30:40 +0300 Subject: [PATCH] Backport LLVM's r341717 "Fix flags used to compile benchmark library with clang-cl" (#673) `MSVC` is true for clang-cl, but `"${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"` is false, so we would enable -Wall, which means -Weverything with clang-cl, and we get tons of undesired warnings. Use the simpler condition to fix things. Patch by: Reid Kleckner @rnk --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8631199211..fff85b14b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ if (BENCHMARK_BUILD_32_BITS) add_required_cxx_compiler_flag(-m32) endif() -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +if (MSVC) # Turn compiler warnings up to 11 string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")