From: Nick Hutchinson Date: Sun, 2 May 2021 13:46:12 +0000 (+0100) Subject: CMake: fix excessive build warnings when building with clang-cl X-Git-Tag: v1.5.0^2~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d34062836f73e2ac6e58a536482edebab387d4b;p=thirdparty%2Fzstd.git CMake: fix excessive build warnings when building with clang-cl --- diff --git a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake index 623897170..e23b9d603 100644 --- a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +++ b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake @@ -26,7 +26,12 @@ macro(ADD_ZSTD_COMPILATION_FLAGS) EnableCompilerFlag("-std=c++11" false true) #Set c99 by default EnableCompilerFlag("-std=c99" true false) - EnableCompilerFlag("-Wall" true true) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) + # clang-cl normally maps -Wall to -Weverything. + EnableCompilerFlag("/clang:-Wall" true true) + else () + EnableCompilerFlag("-Wall" true true) + endif () EnableCompilerFlag("-Wextra" true true) EnableCompilerFlag("-Wundef" true true) EnableCompilerFlag("-Wshadow" true true)