[Cmake-commits] CMake branch, next, updated. v3.1.0-1470-g383c5f1

Robert Maynard robert.maynard at kitware.com
Fri Jan 2 09:12:41 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3 (commit)
       via  51b7afe48fe8b6256a850620764b3ab090af08a5 (commit)
       via  e77371108755670a8f49fac8059796bb61c5abad (commit)
       via  ef26ddcdf1de2da802a07b483fe36dc840e8e4ff (commit)
       via  0a8ad952382a3ee036173480bd0dd946b15a3eb7 (commit)
      from  af5d9cd265bea1b7fedffdcd38f94bd9e92687ed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3
commit 383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3
Merge: af5d9cd 51b7afe
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Fri Jan 2 09:12:39 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 2 09:12:39 2015 -0500

    Merge topic 'feature_record_msvc' into next
    
    51b7afe4 Features: Enable writing of MSVC compiler feature header.
    e7737110 Features: Record for MSVC 2015.
    ef26ddcd Features: Record for MSVC 2010-2013.
    0a8ad952 CompileFeatures: Handle compilers that don't support cxx_final.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51b7afe48fe8b6256a850620764b3ab090af08a5
commit 51b7afe48fe8b6256a850620764b3ab090af08a5
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Dec 22 13:45:18 2014 -0500
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Fri Jan 2 09:10:49 2015 -0500

    Features: Enable writing of MSVC compiler feature header.
    
    Notes:
    VS2015 and above are the only MSVC versions to support cxx_final, so remove
    usages from the tests, and instead only test for cxx_override.
    
    VS2012 and above to conform to cxx_decltype_incomplete_return_types
    proposal, but without support for auto return types the dcl.type.simple
    example in the proposal doesn't compile.
    
    VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. I am hesitant to say that VS2010 and above meet all the requirements of the proposal currently.
    
    Compilers such as MSVC have no explicit flags to enable C++11 mode,
    it just is always on. So only run the link tests with compilers that require
    a flag to specify the language version.

diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake
new file mode 100644
index 0000000..64016bc
--- /dev/null
+++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake
@@ -0,0 +1,24 @@
+
+# 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")
+
+#currently disabling everything while we test
+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
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 36b9706..bcaaafa 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -36,7 +36,7 @@
 #      PREFIX ClimbingStats
 #      OUTPUT_FILES_VAR support_files
 #      OUTPUT_DIR compilers
-#      COMPILERS GNU Clang
+#      COMPILERS GNU Clang MSVC
 #      FEATURES cxx_variadic_templates
 #    )
 #    install(FILES
@@ -100,7 +100,7 @@
 #    write_compiler_detection_header(
 #      FILE climbingstats_compiler_detection.h
 #      PREFIX ClimbingStats
-#      COMPILERS GNU Clang AppleClang
+#      COMPILERS GNU Clang AppleClang MSVC
 #      FEATURES cxx_variadic_templates
 #    )
 #
@@ -316,6 +316,7 @@ function(write_compiler_detection_header
     GNU
     Clang
     AppleClang
+    MSVC
   )
 
   set(_hex_compilers ADSP Borland Embarcadero SunPro)
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index ff5d745..d6f39bf 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -1,5 +1,5 @@
 
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)
 
 project(CompileFeatures)
 
@@ -26,18 +26,30 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
 foreach(feature ${c_features})
   run_test(${feature} C)
 endforeach()
+
 get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
+
+#blacklist for msvc
+if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+  list(REMOVE_ITEM cxx_features
+    #This test requires auto return type deduction to work properly, but
+    #that is not supported by all versions of MSVC that support decltype
+    #incomplete return types.
+    cxx_decltype_incomplete_return_types
+    )
+endif()
+
 foreach(feature ${cxx_features})
   run_test(${feature} CXX)
 endforeach()
 
-if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
     AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
   list(REMOVE_ITEM CXX_non_features
     cxx_alignof
   )
 endif()
-if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
     AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
   # GNU prior to 4.9 does not set any preprocessor define to distinguish
   # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9.
@@ -50,6 +62,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
     cxx_return_type_deduction
   )
 endif()
+if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+  list(REMOVE_ITEM CXX_non_features
+    #Micrsoft only officially supports this feature in VS2013 and above, due
+    #to new wording of the proposal. We don't test for this with MSVC because
+    #older compiler pass the test but might not actually conform
+    cxx_contextual_conversions
+    )
+endif()
 
 set(C_ext c)
 set(C_standard_flag 11)
@@ -122,15 +142,15 @@ if (CMAKE_CXX_COMPILE_FEATURES)
 
   add_executable(CompileFeaturesGenex genex_test.cpp)
   set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
-  target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_override>)
 
   add_executable(CompileFeaturesGenex2 genex_test.cpp)
-  target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr)
-  target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert)
+  target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_override>)
 
-  add_library(noexcept_iface INTERFACE)
-  target_compile_features(noexcept_iface INTERFACE cxx_noexcept)
+  add_library(nullptr_iface INTERFACE)
+  target_compile_features(nullptr_iface INTERFACE cxx_nullptr)
   add_executable(CompileFeaturesGenex3 genex_test.cpp)
-  target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface)
-  target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  target_link_libraries(CompileFeaturesGenex3 PRIVATE nullptr_iface)
+  target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_override>)
 endif()
diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp
index ca38883..1d30884 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -8,7 +8,7 @@ struct A
   virtual int getA() { return 7; }
 };
 
-struct B final : A
+struct B : A
 {
   int getA() override { return 42; }
 };
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 5b2f1de..cbfe3f3 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.1.0)
 project(WriteCompilerDetectionHeader)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -11,7 +11,7 @@ get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
 write_compiler_detection_header(
   FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h"
   PREFIX TEST
-  COMPILERS GNU Clang AppleClang
+  COMPILERS GNU Clang AppleClang MSVC
   VERSION 3.1
   PROLOG "// something"
   EPILOG "// more"
@@ -56,17 +56,29 @@ macro(set_defines target true_defs false_defs)
   )
 endmacro()
 
-if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
-    OR CMAKE_CXX_COMPILER_ID STREQUAL Clang
-    OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+    OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
+    OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
   # False for C++98 mode.
   list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
   list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
 endif()
 
-if (CMAKE_C_COMPILER_ID STREQUAL GNU
-    OR CMAKE_C_COMPILER_ID STREQUAL Clang
-    OR CMAKE_C_COMPILER_ID STREQUAL AppleClang)
+#for msvc the version determines if we support delegating constructors
+#and variadic templates. Luckily support for both of these features was
+#added in the same msvc version (1800)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
+    ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;")
+  list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
+  list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
+else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+  list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
+  list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
+endif()
+
+if (CMAKE_C_COMPILER_ID STREQUAL "GNU"
+    OR CMAKE_C_COMPILER_ID STREQUAL "Clang"
+    OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
   add_executable(C_undefined c_undefined.c)
   set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90)
   target_compile_options(C_undefined PRIVATE -Werror=undef)
@@ -81,7 +93,7 @@ write_compiler_detection_header(
   PREFIX MULTI
   OUTPUT_FILES_VAR multi_files
   OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
-  COMPILERS GNU Clang AppleClang
+  COMPILERS GNU Clang AppleClang MSVC
   VERSION 3.1
   FEATURES
     ${cxx_known_features} ${c_known_features}
diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
index 1892a5c..e4abed5 100644
--- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
@@ -27,8 +27,13 @@ if (NOT CXX_FEATURES)
   run_cmake(NoSupportedCxxFeatures)
   run_cmake(NoSupportedCxxFeaturesGenex)
 else()
-  run_cmake(LinkImplementationFeatureCycle)
-  run_cmake(LinkImplementationFeatureCycleSolved)
+  #compilers such as MSVC have no explicit flags to enable C++11 mode,
+  #it just is always on. So only run the link tests with compilers that require
+  #a flag to specify the language version.
+  if(CMAKE_CXX11_STANDARD_COMPILE_OPTION)
+    run_cmake(LinkImplementationFeatureCycle)
+    run_cmake(LinkImplementationFeatureCycleSolved)
+  endif()
 
   if (";${CXX_FEATURES};" MATCHES ";cxx_final;")
     set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e77371108755670a8f49fac8059796bb61c5abad
commit e77371108755670a8f49fac8059796bb61c5abad
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Dec 22 10:25:18 2014 -0500
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Fri Jan 2 09:10:48 2015 -0500

    Features: Record for MSVC 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.

diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
index 18dea24..2dba314 100644
--- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
@@ -1,8 +1,35 @@
 
 # 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(_oldestSupported "_MSC_VER >= 1600")
+
+set(_cmake_oldestSupported "_MSC_VER >= 1600")
+
+set(MSVC_2015 "_MSC_VER >= 1900")
+set(_cmake_feature_test_cxx_alignas "${MSVC_2015}")
+set(_cmake_feature_test_cxx_alignof "${MSVC_2015}")
+set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}")
+set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}")
+set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}")
+set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}")
+# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
+# Note 1. While previous version of VisualStudio said they supported this
+# they silently produced bad code, and are now marked as having partial
+# support
+set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}")
+set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}")
+set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}")
+set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}")
+set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}")
+set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}")
+set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}")
+set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}")
+set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}")
+set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}")
+set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}")
+set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}")
 
 set(MSVC_2013 "_MSC_VER >= 1800")
 set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
@@ -11,14 +38,16 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}")
 set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}")
 set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}")
 set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}")
-# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221
-set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}")
 set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}")
 set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}")
 set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}")
 # Possibly broken:
 # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333
 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}")
+# Microsoft now states they support contextual conversions
+# see footnote 6 at:
+#  http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
+set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}")
 
 set(MSVC_2012 "_MSC_VER >= 1700")
 set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}")
@@ -42,24 +71,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}")
 set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}")
 set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}")
 set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}")
+set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}")
 set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}")
 
 # Currently unsupported:
 # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/
-# set(_cmake_feature_test_cxx_reference_qualified_functions )
-# set(_cmake_feature_test_cxx_inheriting_constructors )
-# set(_cmake_feature_test_cxx_alignas )
-# set(_cmake_feature_test_cxx_alignof )
-# set(_cmake_feature_test_cxx_thread_local )
-# set(_cmake_feature_test_cxx_func_identifier )
-# set(_cmake_feature_test_cxx_sizeof_member )
+# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
 
-# set(_cmake_feature_test_cxx_user_literals )
-# set(_cmake_feature_test_cxx_unrestricted_unions )
-# set(_cmake_feature_test_cxx_unicode_literals )
-# set(_cmake_feature_test_cxx_inline_namespaces )
+# set(_cmake_feature_test_cxx_reference_qualified_functions )
 # set(_cmake_feature_test_cxx_constexpr )
-# set(_cmake_feature_test_cxx_noexcept )
 # set(_cmake_feature_test_cxx_attributes )
+# set(_cmake_feature_test_cxx_aggregate_default_initializers )
+# set(_cmake_feature_test_cxx_attribute_deprecated )
+# set(_cmake_feature_test_cxx_defaulted_move_initializers )
+# set(_cmake_feature_test_cxx_nonstatic_member_init )
+# set(_cmake_feature_test_cxx_relaxed_constexpr )
+# set(_cmake_feature_test_cxx_variable_templates )
+
 
-set(_oldestSupported)
+#Unset all the variables that we don't need exposed.
+#_cmake_oldestSupported is required by WriteCompilerDetectionHeader
+set(MSVC_2015)
+set(MSVC_2013)
+set(MSVC_2012)
+set(MSVC_2010)
diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake
index cbe1586..c7792eb 100644
--- a/Modules/Platform/Windows-MSVC-C.cmake
+++ b/Modules/Platform/Windows-MSVC-C.cmake
@@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
   set(_FS_C " /FS")
 endif()
 __windows_compiler_msvc(C)
+
+set(CMAKE_C_STANDARD_DEFAULT 90)
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
index 89885b8..d0599f9 100644
--- a/Modules/Platform/Windows-MSVC-CXX.cmake
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
 endif()
 __windows_compiler_msvc(CXX)
 
+#No version of MSVC has full conformance to C++11. Therefore the
+#__cplusplus macro always evaluates to 98 even if the compilers come with
+#C++11/14/+ features enabled.
+set(CMAKE_CXX_STANDARD_DEFAULT 98)
+
 macro(cmake_record_cxx_compile_features)
   record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
 endmacro()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef26ddcdf1de2da802a07b483fe36dc840e8e4ff
commit ef26ddcdf1de2da802a07b483fe36dc840e8e4ff
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 15:55:37 2014 +0200
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Fri Jan 2 09:10:48 2015 -0500

    Features: Record for MSVC 2010-2013.

diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..18dea24
--- /dev/null
+++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
@@ -0,0 +1,65 @@
+
+# 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
+
+set(_oldestSupported "_MSC_VER >= 1600")
+
+set(MSVC_2013 "_MSC_VER >= 1800")
+set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
+set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}")
+set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}")
+set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}")
+set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}")
+set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}")
+# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221
+set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}")
+set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}")
+set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}")
+set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}")
+# Possibly broken:
+# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333
+set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}")
+
+set(MSVC_2012 "_MSC_VER >= 1700")
+set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}")
+set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}")
+set(_cmake_feature_test_cxx_final "${MSVC_2012}")
+set(_cmake_feature_test_cxx_range_for "${MSVC_2012}")
+set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}")
+
+set(MSVC_2010 "_MSC_VER >= 1600")
+set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}")
+set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}")
+set(_cmake_feature_test_cxx_decltype "${MSVC_2010}")
+set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}")
+set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}")
+set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}")
+set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}")
+set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}")
+set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}")
+set(_cmake_feature_test_cxx_override "${MSVC_2010}")
+set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}")
+set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}")
+set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}")
+set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}")
+set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}")
+
+# Currently unsupported:
+# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/
+# set(_cmake_feature_test_cxx_reference_qualified_functions )
+# set(_cmake_feature_test_cxx_inheriting_constructors )
+# set(_cmake_feature_test_cxx_alignas )
+# set(_cmake_feature_test_cxx_alignof )
+# set(_cmake_feature_test_cxx_thread_local )
+# set(_cmake_feature_test_cxx_func_identifier )
+# set(_cmake_feature_test_cxx_sizeof_member )
+
+# set(_cmake_feature_test_cxx_user_literals )
+# set(_cmake_feature_test_cxx_unrestricted_unions )
+# set(_cmake_feature_test_cxx_unicode_literals )
+# set(_cmake_feature_test_cxx_inline_namespaces )
+# set(_cmake_feature_test_cxx_constexpr )
+# set(_cmake_feature_test_cxx_noexcept )
+# set(_cmake_feature_test_cxx_attributes )
+
+set(_oldestSupported)
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
index 0e85005..89885b8 100644
--- a/Modules/Platform/Windows-MSVC-CXX.cmake
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
   set(_FS_CXX " /FS")
 endif()
 __windows_compiler_msvc(CXX)
+
+macro(cmake_record_cxx_compile_features)
+  record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
+endmacro()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a8ad952382a3ee036173480bd0dd946b15a3eb7
commit 0a8ad952382a3ee036173480bd0dd946b15a3eb7
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Wed Dec 31 10:25:33 2014 -0500
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Fri Jan 2 09:10:08 2015 -0500

    CompileFeatures: Handle compilers that don't support cxx_final.
    
    Previously we expanded HAVE_FINAL to determine what the copied_file number
    would be, but when we don't have cxx_final than HAVE_FINAL is not defined.
    What we really want is to use expected_result.

diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
index c6707c1..b544b99 100644
--- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
+++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
@@ -7,7 +7,7 @@ else()
   set(expected_result 0)
 endif()
 
-add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp"
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp"
   COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp"
 )
 

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list