From e669471acac62a04a4c8f152d37e78b32d41df79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Camilla=20L=C3=B6wy?= <elmindreda@elmindreda.org>
Date: Wed, 7 Oct 2020 22:50:54 +0200
Subject: [PATCH] Win32: Enable /W3 on VS for library sources

/W3 is the default for new VS projects and the library builds cleanly
with it on VS 2010-2019 so let's try to keep it that way.

(cherry picked from commit 6b78419c9ae8d504e3b44adab51645d89c23108c)
---
 src/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8c1a1d7f..9519597d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -120,12 +120,14 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
                                 COMPILE_FLAGS -Wdeclaration-after-statement)
 endif()
 
+# Enable a reasonable set of warnings
 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
     "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
     "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
 
-    # Enable a reasonable set of warnings (no, -Wextra is not reasonable)
     target_compile_options(glfw PRIVATE "-Wall")
+elseif (MSVC)
+    target_compile_options(glfw PRIVATE "/W3")
 endif()
 
 if (WIN32)