From 7dee4e05f92052ccb289a7bf565a7e889a33f42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 22:51:58 +0200 Subject: [PATCH] Win32: Fix clang-cl interpreting -Wall as /Wall Unlike -Wall, VS /Wall really means all warnings. Closes #1780. (cherry picked from commit ac627706ef93362caf08bd3bf249656efd9151e8) --- README.md | 1 + src/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3af3efe..1a1f0316 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ skills. - Eloi Marín Gratacós - Stefan Gustavson - Jonathan Hale + - hdf89shfdfs - Sylvain Hellegouarch - Matthew Henry - heromyth diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9519597d..402f8f6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,7 +125,12 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - target_compile_options(glfw PRIVATE "-Wall") + if ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") + # Tell Clang-CL that this is a Clang flag + target_compile_options(glfw PRIVATE "/clang:-Wall") + else() + target_compile_options(glfw PRIVATE "-Wall") + endif() elseif (MSVC) target_compile_options(glfw PRIVATE "/W3") endif()