[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-1956-gacb508b
Stephen Kelly
steveire at gmail.com
Sun Apr 6 05:56:23 EDT 2014
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 acb508bcf8a015c4b78ad2690ed6cb2cd60c396a (commit)
via 0a3e7ff2080ad3ba0ebe708399fabdcaa9842bc2 (commit)
from 7bf0f2b264c52d3fe1fd6a7f7b5fbff549d7a636 (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=acb508bcf8a015c4b78ad2690ed6cb2cd60c396a
commit acb508bcf8a015c4b78ad2690ed6cb2cd60c396a
Merge: 7bf0f2b 0a3e7ff
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 05:56:22 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 6 05:56:22 2014 -0400
Merge topic 'cxx98-features' into next
0a3e7ff2 Features: Add C++98 cxx_template_template_parameters.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a3e7ff2080ad3ba0ebe708399fabdcaa9842bc2
commit 0a3e7ff2080ad3ba0ebe708399fabdcaa9842bc2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 11:40:11 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 11:54:21 2014 +0200
Features: Add C++98 cxx_template_template_parameters.
Extend the existing C++11 feature infrastructure as needed.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index ad599a3..222a3c8 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -230,3 +230,6 @@ The features known to this version of CMake are:
``long long`` type, as defined in N1811_.
.. _N1811: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
+
+``cxx_template_template_parameters``
+ Template template parameters, as defined in ``ISO/IEC 14882:1998``.
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index fdee336..6e531ca 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -3,6 +3,7 @@ set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
+set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index 40aa9d6..583ff8d 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -17,6 +17,7 @@ function(cmake_determine_compile_features lang)
if(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features)
message(STATUS "Detecting ${lang} compile features")
+ set(CMAKE_CXX98_COMPILE_FEATURES)
set(CMAKE_CXX11_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -28,13 +29,19 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CXX98_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES})
+ endif()
+
if(NOT CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_COMPILE_FEATURES
+ ${CMAKE_CXX98_COMPILE_FEATURES}
${CMAKE_CXX11_COMPILE_FEATURES}
)
endif()
set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX98_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
message(STATUS "Detecting ${lang} compile features - done")
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 39b77b2..e5fec8c 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -76,4 +76,5 @@ set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus
# TODO: Should be supported forever?
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_template_template_parameters "${_oldestSupported} && __cplusplus >= 199711L")
set(_oldestSupported)
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 7acad52..59d589a 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -31,6 +31,7 @@ macro(cmake_record_cxx_compile_features)
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
_get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
+ _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES)
else()
set(_result 0)
endif()
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 31b074c..e3a3f07 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -85,7 +85,8 @@
F(cxx_extended_friend_declarations) \
F(cxx_local_type_template_args) \
F(cxx_func_identifier) \
- F(cxx_long_long_type)
+ F(cxx_long_long_type) \
+ F(cxx_template_template_parameters)
class cmMakefile::Internals
{
@@ -4626,8 +4627,16 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
target->AppendProperty("COMPILE_FEATURES", feature.c_str());
+ bool needCxx98 = false;
bool needCxx11 = false;
+ if (const char *propCxx98 =
+ this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES"))
+ {
+ std::vector<std::string> props;
+ cmSystemTools::ExpandListArgument(propCxx98, props);
+ needCxx98 = std::find(props.begin(), props.end(), feature) != props.end();
+ }
if (const char *propCxx11 =
this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES"))
{
@@ -4655,6 +4664,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
cmStrCmp(existingCxxStandard))
: cmArrayEnd(CXX_STANDARDS);
+ bool setCxx98 = needCxx98 && !existingCxxStandard;
bool setCxx11 = needCxx11 && !existingCxxStandard;
if (needCxx11 && existingCxxStandard && existingCxxIt <
@@ -4664,10 +4674,21 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
{
setCxx11 = true;
}
+ else if(needCxx98 && existingCxxStandard && existingCxxIt <
+ std::find_if(cmArrayBegin(CXX_STANDARDS),
+ cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp("98")))
+ {
+ setCxx98 = true;
+ }
if (setCxx11)
{
target->SetProperty("CXX_STANDARD", "11");
}
+ else if (setCxx98)
+ {
+ target->SetProperty("CXX_STANDARD", "98");
+ }
return true;
}
diff --git a/Tests/CompileFeatures/cxx_template_template_parameters.cpp b/Tests/CompileFeatures/cxx_template_template_parameters.cpp
new file mode 100644
index 0000000..0fdd18d
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_template_template_parameters.cpp
@@ -0,0 +1,18 @@
+
+template<template <typename> class T, typename U>
+void someFunc(T<U>)
+{
+
+}
+
+template<typename T>
+struct A
+{
+
+};
+
+void otherFunc()
+{
+ A<int> a;
+ someFunc(a);
+}
diff --git a/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in
index 954a2fe..9966e8d 100644
--- a/Tests/SystemInformation/SystemInformation.in
+++ b/Tests/SystemInformation/SystemInformation.in
@@ -26,6 +26,7 @@ CMAKE_CXX11_STANDARD_COMPILE_OPTION == "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}"
CMAKE_CXX98_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX98_EXTENSION_COMPILE_OPTION}"
CMAKE_CXX11_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}"
CMAKE_CXX_COMPILE_FEATURES == "${CMAKE_CXX_COMPILE_FEATURES}"
+CMAKE_CXX98_COMPILE_FEATURES == "${CMAKE_CXX98_COMPILE_FEATURES}"
CMAKE_CXX11_COMPILE_FEATURES == "${CMAKE_CXX11_COMPILE_FEATURES}"
// C shared library flag
-----------------------------------------------------------------------
Summary of changes:
Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 3 +++
Modules/CMakeCXXCompiler.cmake.in | 1 +
Modules/CMakeDetermineCompileFeatures.cmake | 7 ++++++
Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 +
Modules/Compiler/GNU-CXX.cmake | 1 +
Source/cmMakefile.cxx | 23 +++++++++++++++++++-
.../cxx_template_template_parameters.cpp | 18 +++++++++++++++
Tests/SystemInformation/SystemInformation.in | 1 +
8 files changed, 54 insertions(+), 1 deletion(-)
create mode 100644 Tests/CompileFeatures/cxx_template_template_parameters.cpp
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list