summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-04 11:11:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:56 (GMT)
commit32c2acd65c3d48433a50a6c2f9fc00c2a1a699f4 (patch)
treeb4f1e3bbda60383008200d8d7611f37733d5023b
parent9064f78b0c07a79f25ee04cf8afaf726d18ec722 (diff)
downloadCMake-32c2acd65c3d48433a50a6c2f9fc00c2a1a699f4.zip
CMake-32c2acd65c3d48433a50a6c2f9fc00c2a1a699f4.tar.gz
CMake-32c2acd65c3d48433a50a6c2f9fc00c2a1a699f4.tar.bz2
Features: Add cxx_extern_templates.
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake2
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_extern_templates.cpp12
4 files changed, 20 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 0a2f23c..6c4bc15 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -52,6 +52,11 @@ The features known to this version of CMake are:
.. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
+``cxx_extern_templates``
+ Extern templates, as defined in N1987_.
+
+ .. _N1987: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
+
``cxx_final``
Override control ``final`` keyword, as defined in N2928_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index bd3e96e..ee7f2e4 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -53,4 +53,6 @@ set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
+# TODO: Should be supported since GNU 3.4?
+set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
set(_oldestSupported)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index aa9b7c7..1803afe 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -50,6 +50,7 @@
F(cxx_delegating_constructors) \
F(cxx_deleted_functions) \
F(cxx_explicit_conversions) \
+ F(cxx_extern_templates) \
F(cxx_final) \
F(cxx_inheriting_constructors) \
F(cxx_lambdas) \
diff --git a/Tests/CompileFeatures/cxx_extern_templates.cpp b/Tests/CompileFeatures/cxx_extern_templates.cpp
new file mode 100644
index 0000000..9fa4aa4
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_extern_templates.cpp
@@ -0,0 +1,12 @@
+
+template<typename T>
+void someFunc()
+{
+}
+
+extern template void someFunc<int>();
+
+void otherFunc()
+{
+ someFunc<int>();
+}