[Cmake-commits] CMake branch, next, updated. v3.1.1-2455-gdb4f916
Brad King
brad.king at kitware.com
Thu Jan 29 10:25: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 db4f91629fc1ad0519713f3af9999ae84cb27b49 (commit)
via 4931de8c2666436802ed96a31a8b76f01042b0f2 (commit)
via 440242818dd9fc99c5034af5c299dab063c62c8d (commit)
via c4ddc92f912576e1499478abcf178b351b9e07f8 (commit)
from f311a36cf47cf16d704427d59a31f597097d8a24 (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=db4f91629fc1ad0519713f3af9999ae84cb27b49
commit db4f91629fc1ad0519713f3af9999ae84cb27b49
Merge: f311a36 4931de8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 29 10:25:40 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 29 10:25:40 2015 -0500
Merge topic 'feature-record-msvc' into next
4931de8c fixup! Features: Record for MSVC 2010-2015
44024281 fixup! Features: Define meaning for no language standard default
c4ddc92f Help: Document <LANG>_STANDARD having no effect for MSVC
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4931de8c2666436802ed96a31a8b76f01042b0f2
commit 4931de8c2666436802ed96a31a8b76f01042b0f2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 29 09:42:30 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 29 10:23:27 2015 -0500
fixup! Features: Record for MSVC 2010-2015
diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
index 476f244..d69a7ef 100644
--- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
@@ -21,7 +21,8 @@ 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
+# support in previous versions. The footnote says the support will be complete
+# in MSVC 2015, so support the feature for that version, assuming that is true.
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}")
@@ -37,6 +38,10 @@ set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}")
set(MSVC_2013 "_MSC_VER >= 1800")
set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
+# Microsoft now states they support contextual conversions in 2013 and above.
+# 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(_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}")
@@ -45,7 +50,8 @@ set(_cmake_feature_test_cxx_explicit_conversions "${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:
+# Support is documented, but possibly partly broken:
+# https://msdn.microsoft.com/en-us/library/hh567368.aspx
# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333
set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}")
@@ -58,10 +64,6 @@ 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}")
-# 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_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}")
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 5f8fbc0..bc823ca 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -91,6 +91,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
cxx_return_type_deduction
)
endif()
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
+ list(REMOVE_ITEM CXX_non_features
+ # The cxx_contextual_conversions feature happens to work
+ # (for *this* testcase) with VS 2010 and VS 2012, but
+ # they do not document support until VS 2013.
+ cxx_contextual_conversions
+ )
+endif()
set(C_ext c)
set(C_standard_flag 11)
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 43e89ab..65e60b2 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -68,15 +68,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
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)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ if(";${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()
+ list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
+ list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
+ endif()
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=440242818dd9fc99c5034af5c299dab063c62c8d
commit 440242818dd9fc99c5034af5c299dab063c62c8d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 29 09:40:20 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 29 10:23:27 2015 -0500
fixup! Features: Define meaning for no language standard default
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 5f246f9..6692a92 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -1370,6 +1370,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
std::vector<std::string> const& langAvailable
= availableFeatures[lit->first];
+ const char* standardDefault = context->Makefile
+ ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT");
for (std::vector<std::string>::const_iterator it = lit->second.begin();
it != lit->second.end(); ++it)
{
@@ -1378,6 +1380,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
return "0";
}
+ if (standardDefault && !*standardDefault)
+ {
+ // This compiler has no notion of language standard levels.
+ // All features known for the language are always available.
+ continue;
+ }
if (!context->Makefile->HaveStandardAvailable(target,
lit->first, *it))
{
@@ -1386,8 +1394,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
const char* l = target->GetProperty(lit->first + "_STANDARD");
if (!l)
{
- l = context->Makefile
- ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT");
+ l = standardDefault;
}
assert(l);
context->MaxLanguageStandard[target][lit->first] = l;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b5ff732..ba914e1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -5264,12 +5264,6 @@ HaveCStandardAvailable(cmTarget const* target,
// Return true so the caller does not try to lookup the default standard.
return true;
}
- if (!*defaultCStandard)
- {
- // This compiler has no notion of language standard levels.
- // All features known for the language are always available.
- return true;
- }
if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS))
{
@@ -5369,12 +5363,6 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
// Return true so the caller does not try to lookup the default standard.
return true;
}
- if (!*defaultCxxStandard)
- {
- // This compiler has no notion of language standard levels.
- // All features known for the language are always available.
- return true;
- }
if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS))
{
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4ddc92f912576e1499478abcf178b351b9e07f8
commit c4ddc92f912576e1499478abcf178b351b9e07f8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 29 09:35:49 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 29 09:35:49 2015 -0500
Help: Document <LANG>_STANDARD having no effect for MSVC
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 65b3a72..e18250c 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -80,7 +80,9 @@ When adding the first supported feature to a particular CompilerId, it is
necessary to list support for all features known to cmake (See
:variable:`CMAKE_C_COMPILE_FEATURES` and
:variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for
-the compiler.
+the compiler. Furthermore, set ``CMAKE_<LANG>_STANDARD_DEFAULT`` to the
+default language standard level the compiler uses, or to the empty string
+if the compiler has no notion of standard levels (such as ``MSVC``).
It is sensible to record the features for the most recent version of a
particular CompilerId first, and then work backwards. It is sensible to
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index 6329e34..65b30ec 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -5,7 +5,8 @@ The C++ standard whose features are requested to build this target.
This property specifies the C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
-flag such as ``-std=gnu++11`` to the compile line.
+flag such as ``-std=gnu++11`` to the compile line. For compilers that
+have no notion of a standard level, such as MSVC, this has no effect.
Supported values are ``98``, ``11`` and ``14``.
diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
index ac103a4..4e24e5e 100644
--- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
@@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the
:prop_tgt:`CXX_STANDARD` target property is treated as a requirement. If this
property is ``OFF`` or unset, the :prop_tgt:`CXX_STANDARD` target property is
treated as optional and may "decay" to a previous standard if the requested is
-not available.
+not available. For compilers that have no notion of a standard level, such as
+MSVC, this has no effect.
See the :manual:`cmake-compile-features(7)` manual for information on
compile features.
diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst
index 88ca926..3aa74af 100644
--- a/Help/prop_tgt/C_STANDARD.rst
+++ b/Help/prop_tgt/C_STANDARD.rst
@@ -5,7 +5,8 @@ The C standard whose features are requested to build this target.
This property specifies the C standard whose features are requested
to build this target. For some compilers, this results in adding a
-flag such as ``-std=gnu11`` to the compile line.
+flag such as ``-std=gnu11`` to the compile line. For compilers that
+have no notion of a standard level, such as MSVC, this has no effect.
Supported values are ``90``, ``99`` and ``11``.
diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst
index a7304f4..743d568 100644
--- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst
@@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the
:prop_tgt:`C_STANDARD` target property is treated as a requirement. If this
property is ``OFF`` or unset, the :prop_tgt:`C_STANDARD` target property is
treated as optional and may "decay" to a previous standard if the requested is
-not available.
+not available. For compilers that have no notion of a standard level, such as
+MSVC, this has no effect.
See the :manual:`cmake-compile-features(7)` manual for information on
compile features.
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-developer.7.rst | 4 +++-
Help/prop_tgt/CXX_STANDARD.rst | 3 ++-
Help/prop_tgt/CXX_STANDARD_REQUIRED.rst | 3 ++-
Help/prop_tgt/C_STANDARD.rst | 3 ++-
Help/prop_tgt/C_STANDARD_REQUIRED.rst | 3 ++-
Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 14 ++++++++------
Source/cmGeneratorExpressionEvaluator.cxx | 11 +++++++++--
Source/cmMakefile.cxx | 12 ------------
Tests/CompileFeatures/CMakeLists.txt | 9 +++++++++
.../WriteCompilerDetectionHeader/CMakeLists.txt | 17 ++++++++---------
10 files changed, 45 insertions(+), 34 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list