[Cmake-commits] CMake branch, next, updated. v3.1.0-1665-gb71ecfb

Stephen Kelly steveire at gmail.com
Sun Jan 11 10:50:44 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  b71ecfb867f90c0f29f3ad9e0636b51726419bde (commit)
       via  3d809d5909d79fb78afb61317e8c2df0ada99d81 (commit)
       via  18adaaf5f93dbea14c98a77305c876806c6eb326 (commit)
       via  64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 (commit)
       via  225c0ef88bf21c39694b51798390b87328a163de (commit)
       via  a15675efc3d96906d4e803def2e83fd3bd1cf812 (commit)
       via  07d1f6fca1d6ea21dea64b32639c44d5eecf98a6 (commit)
      from  1e34d70d79927b9ed68111528bdde02cbfd1afa6 (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=b71ecfb867f90c0f29f3ad9e0636b51726419bde
commit b71ecfb867f90c0f29f3ad9e0636b51726419bde
Merge: 1e34d70 3d809d5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 11 10:50:43 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 11 10:50:43 2015 -0500

    Merge topic 'feature_record_msvc' into next
    
    3d809d59 Only disable cxx_contextual_conversions on MSVC 2012 and older.
    18adaaf5 Features: Enable writing of MSVC compiler feature header.
    64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
    225c0ef8 Features: Record for MSVC 2010-2013.
    a15675ef Features: Quote all compiler names when comparing with COMPILER_ID
    07d1f6fc Features: Properly evaluate if the compiler supports cxx_final.

diff --cc Tests/CompileFeatures/CMakeLists.txt
index a77b399,9fb8d1b..b34640d
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@@ -63,14 -63,6 +63,25 @@@ 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(MSVC_)
++if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
++   MSVC_VERSION LESS 1800)
++  list(REMOVE_ITEM CXX_non_features
++    # Microsoft 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(MSVC_)
  if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d809d5909d79fb78afb61317e8c2df0ada99d81
commit 3d809d5909d79fb78afb61317e8c2df0ada99d81
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Jan 5 14:55:42 2015 -0500
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    Only disable cxx_contextual_conversions on MSVC 2012 and older.

diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 0bcae32..9fb8d1b 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -63,9 +63,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
     cxx_return_type_deduction
   )
 endif()
-if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+
+set(MSVC_)
+if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
+   MSVC_VERSION LESS 1800)
   list(REMOVE_ITEM CXX_non_features
-    # Micrsoft only officially supports this feature in VS2013 and above, due
+    # Microsoft 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

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18adaaf5f93dbea14c98a77305c876806c6eb326
commit 18adaaf5f93dbea14c98a77305c876806c6eb326
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Tue Jan 6 13:19:44 2015 -0500
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    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.
    
    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/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 b164f06..0bcae32 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -26,7 +26,18 @@ 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)
+
+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()
@@ -52,6 +63,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)
@@ -126,6 +145,7 @@ 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>
     HAVE_NULLPTR=$<COMPILE_FEATURES:cxx_nullptr>
diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp
index f667cc4..4412569 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -10,7 +10,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 401de95..cfaa78c 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -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"
@@ -64,6 +64,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
   list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
 endif()
 
+# for msvc the compiler version determines which c++11 features are available.
+# Both variadic templates and delegating constructors support exist in
+# all versions that we write compile headers for.
+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")
@@ -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..3b37091 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.
+  # Instead they come with all c++11 features implicitly enabled.
+  # So for those types of compilers this tests is not applicable.
+  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=64c30bdc48d0a3e1da48fdbfeb200740fa5dac43
commit 64c30bdc48d0a3e1da48fdbfeb200740fa5dac43
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Dec 22 10:25:18 2014 -0500
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    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.

diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake
new file mode 100644
index 0000000..e449358
--- /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
diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
index 18dea24..b238fde 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..ad56f68 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=225c0ef88bf21c39694b51798390b87328a163de
commit 225c0ef88bf21c39694b51798390b87328a163de
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 15:55:37 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    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=a15675efc3d96906d4e803def2e83fd3bd1cf812
commit a15675efc3d96906d4e803def2e83fd3bd1cf812
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Tue Jan 6 13:31:30 2015 -0500
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    Features: Quote all compiler names when comparing with COMPILER_ID
    
    In preparation of adding MSVC support we need to quote all compiler names,
    as MSVC is also a CMake variable.

diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 834ac7c..b164f06 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)
 
@@ -31,7 +31,7 @@ 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)
   # The cxx_alignof feature happens to work (for *this* testcase) with
   # GNU 4.7, but it is first documented as available with GNU 4.8.
@@ -39,7 +39,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
     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.
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 5b2f1de..401de95 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)
@@ -56,17 +56,17 @@ 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)
+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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07d1f6fca1d6ea21dea64b32639c44d5eecf98a6
commit 07d1f6fca1d6ea21dea64b32639c44d5eecf98a6
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Wed Dec 31 10:25:33 2014 -0500
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:47:58 2015 +0100

    Features: Properly evaluate if the compiler supports 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..4de8e88 100644
--- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
+++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake
@@ -7,11 +7,11 @@ 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"
 )
 
-add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp")
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp")
 if (HAVE_FINAL)
   target_compile_features(empty PRIVATE cxx_final)
 endif()

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

Summary of changes:
 Tests/CompileFeatures/CMakeLists.txt |   11 +++++++++++
 1 file changed, 11 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list