summaryrefslogtreecommitdiff
path: root/Modules/Compiler/MSVC-C-FeatureTests.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2014-12-22 10:25:18 -0500
committerStephen Kelly <steveire@gmail.com>2015-01-11 16:47:58 +0100
commit64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 (patch)
tree594a91878a7d178e026c4079b04def6c964074d7 /Modules/Compiler/MSVC-C-FeatureTests.cmake
parent225c0ef88bf21c39694b51798390b87328a163de (diff)
downloadcmake-64c30bdc48d0a3e1da48fdbfeb200740fa5dac43.tar.gz
Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists but silently produced bad code.
Diffstat (limited to 'Modules/Compiler/MSVC-C-FeatureTests.cmake')
-rw-r--r--Modules/Compiler/MSVC-C-FeatureTests.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake
new file mode 100644
index 0000000000..e44935807f
--- /dev/null
+++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake
@@ -0,0 +1,23 @@
+
+# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx
+# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx
+# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
+# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx
+
+set(_cmake_oldestSupported "_MSC_VER >= 1300")
+
+set(MSVC_2010 "_MSC_VER >= 1600")
+set(_cmake_feature_test_c_static_assert "${MSVC_2010}")
+set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}")
+
+set(MSVC_2003 "_MSC_VER >= 1300")
+set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}")
+
+# Currently unsupported:
+# restrict requires the __restrict syntax in msvc
+# set(_cmake_feature_test_c_restrict)
+
+# Unset all the variables that we don't need exposed.
+# _cmake_oldestSupported is required by WriteCompilerDetectionHeader
+set(MSVC_2010)
+set(MSVC_2003) \ No newline at end of file