]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
CMake: fix excessive build warnings when building with clang-cl 2600/head
authorNick Hutchinson <nshutchinson@gmail.com>
Sun, 2 May 2021 13:46:12 +0000 (14:46 +0100)
committerNick Hutchinson <nshutchinson@gmail.com>
Thu, 6 May 2021 17:46:37 +0000 (18:46 +0100)
build/cmake/CMakeModules/AddZstdCompilationFlags.cmake

index 6238971704d0da6e57f180afabbd1e637d75dee9..e23b9d603eb7a94ecbc289eba412c72c256601aa 100644 (file)
@@ -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)