[waffle] [PATCH] cmake: update minimum required MSVC version to 2013 Update 4

Emil Velikov emil.l.velikov at gmail.com
Thu Feb 5 09:18:37 PST 2015


Currently we mix variable declarations and code, as allowed in the C99
standard. On the other hand, MSVC 2013 prior to Update 4, seems to have
problems with such code in some corner cases.

Considering it's a free update bump the requirement, and add an explicit
check in the build system. Latter of which shamelessly copied from piglit.

v2: Do not evaluate but check the MSVC variable. (Jose)

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 CMakeLists.txt | 5 +++++
 README.txt     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bbe387..96fda82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,11 @@ if(waffle_build_tests)
     include(WaffleCMocka)
 endif()
 
+# Require MSVC 2013 U4
+if (MSVC AND ${CMAKE_C_COMPILER_VERSION} VERSION_LESS 18.00.31101.0)
+    message (FATAL_ERROR "Visual Studio 2013 Update 4 or later required")
+endif ()
+
 find_package(PkgConfig)
 
 # ------------------------------------------------------------------------------
diff --git a/README.txt b/README.txt
index c9ffee2..d37e109 100644
--- a/README.txt
+++ b/README.txt
@@ -120,7 +120,7 @@ Download and install the latest version CMake from the official website:
 
     http://cmake.org/
 
-Install Microsoft Visual Studio 2013* or later.
+Install Microsoft Visual Studio 2013 Update 4* or later.
 Install 'Visual C++' feature.
 
 Download OpenGL Core API and Extension Header Files.
-- 
2.2.2



More information about the waffle mailing list