From 15cdf6f51dde9a394ffc7a398e201e59cc959111 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 3 Apr 2014 19:23:40 +0200 Subject: Features: Add cxx_lambdas. --- Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 +++++ Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 + Source/cmMakefile.cxx | 1 + Tests/CompileFeatures/cxx_lambdas.cpp | 5 +++++ 4 files changed, 12 insertions(+) create mode 100644 Tests/CompileFeatures/cxx_lambdas.cpp diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 41820e0..9441e57 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -57,6 +57,11 @@ The features known to this version of CMake are: .. _N2540: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm +``cxx_lambdas`` + Lambda functions, as defined in N2927_. + + .. _N2927: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf + ``cxx_override`` Override control ``override`` keyword, as defined in N2928_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 6844e28..f182cea 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -20,6 +20,7 @@ set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") +set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") # TODO: Should be supported by GNU 4.4 set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 25a6fee..9352ca5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -51,6 +51,7 @@ F(cxx_explicit_conversions) \ F(cxx_final) \ F(cxx_inheriting_constructors) \ + F(cxx_lambdas) \ F(cxx_override) \ F(cxx_static_assert) \ F(cxx_strong_enums) \ diff --git a/Tests/CompileFeatures/cxx_lambdas.cpp b/Tests/CompileFeatures/cxx_lambdas.cpp new file mode 100644 index 0000000..eecaa23 --- /dev/null +++ b/Tests/CompileFeatures/cxx_lambdas.cpp @@ -0,0 +1,5 @@ + +void someFunc() +{ + [](){}(); +} -- cgit v0.12