cmake/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst

368 lines
11 KiB
ReStructuredText
Raw Normal View History

2015-04-27 22:25:09 +02:00
CMAKE_CXX_KNOWN_FEATURES
------------------------
2021-09-14 00:13:48 +02:00
.. versionadded:: 3.1
2015-04-27 22:25:09 +02:00
List of C++ features known to this version of CMake.
The features listed in this global property may be known to be available to the
C++ compiler. If the feature is available with the C++ compiler, it will
be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable.
The features listed here may be used with the :command:`target_compile_features`
command. See the :manual:`cmake-compile-features(7)` manual for information on
2015-08-17 11:37:30 +02:00
compile features and a list of supported compilers.
2015-04-27 22:25:09 +02:00
2021-09-14 00:13:48 +02:00
The features known to this version of CMake are listed below.
High level meta features indicating C++ standard support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2015-04-27 22:25:09 +02:00
2021-11-20 13:41:27 +01:00
.. versionadded:: 3.8
2021-09-14 00:13:48 +02:00
The following meta features indicate general support for the associated
language standard. It reflects the language support claimed by the compiler,
but it does not necessarily imply complete conformance to that standard.
2015-04-27 22:25:09 +02:00
2017-04-14 19:02:05 +02:00
``cxx_std_98``
2020-02-01 23:06:01 +01:00
Compiler mode is at least C++ 98.
2017-04-14 19:02:05 +02:00
``cxx_std_11``
2020-02-01 23:06:01 +01:00
Compiler mode is at least C++ 11.
2017-04-14 19:02:05 +02:00
``cxx_std_14``
2020-02-01 23:06:01 +01:00
Compiler mode is at least C++ 14.
2017-04-14 19:02:05 +02:00
``cxx_std_17``
2020-02-01 23:06:01 +01:00
Compiler mode is at least C++ 17.
2017-04-14 19:02:05 +02:00
2018-08-09 18:06:22 +02:00
``cxx_std_20``
2021-11-20 13:41:27 +01:00
.. versionadded:: 3.12
2020-02-01 23:06:01 +01:00
Compiler mode is at least C++ 20.
2018-08-09 18:06:22 +02:00
2021-09-14 00:13:48 +02:00
``cxx_std_23``
2021-11-20 13:41:27 +01:00
.. versionadded:: 3.20
2021-09-14 00:13:48 +02:00
Compiler mode is at least C++ 23.
2015-04-27 22:25:09 +02:00
2022-11-16 20:14:03 +01:00
``cxx_std_26``
.. versionadded:: 3.25
Compiler mode is at least C++ 26.
2022-03-29 21:10:50 +02:00
.. include:: CMAKE_LANG_STD_FLAGS.txt
2021-09-14 00:13:48 +02:00
Low level individual compile features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For C++ 11 and C++ 14, compilers were sometimes slow to implement certain
language features. CMake provided some individual compile features to help
projects determine whether specific features were available. These individual
features are now less relevant and projects should generally prefer to use the
high level meta features instead. Individual compile features are not provided
for C++ 17 or later.
See the :manual:`cmake-compile-features(7)` manual for further discussion of
the use of individual compile features.
Individual features from C++ 98
"""""""""""""""""""""""""""""""
``cxx_template_template_parameters``
Template template parameters, as defined in ``ISO/IEC 14882:1998``.
Individual features from C++ 11
"""""""""""""""""""""""""""""""
2015-04-27 22:25:09 +02:00
``cxx_alias_templates``
Template aliases, as defined in N2258_.
2022-11-16 20:14:03 +01:00
.. _N2258: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
2015-04-27 22:25:09 +02:00
``cxx_alignas``
Alignment control ``alignas``, as defined in N2341_.
2022-11-16 20:14:03 +01:00
.. _N2341: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
2015-04-27 22:25:09 +02:00
``cxx_alignof``
Alignment control ``alignof``, as defined in N2341_.
2022-11-16 20:14:03 +01:00
.. _N2341: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
2015-04-27 22:25:09 +02:00
``cxx_attributes``
Generic attributes, as defined in N2761_.
2022-11-16 20:14:03 +01:00
.. _N2761: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
2015-04-27 22:25:09 +02:00
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.
2022-11-16 20:14:03 +01:00
.. _N1984: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
2015-04-27 22:25:09 +02:00
``cxx_constexpr``
Constant expressions, as defined in N2235_.
2022-11-16 20:14:03 +01:00
.. _N2235: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
2015-04-27 22:25:09 +02:00
``cxx_decltype_incomplete_return_types``
Decltype on incomplete return types, as defined in N3276_.
2022-11-16 20:14:03 +01:00
.. _N3276 : https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
2015-04-27 22:25:09 +02:00
``cxx_decltype``
Decltype, as defined in N2343_.
2022-11-16 20:14:03 +01:00
.. _N2343: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
2015-04-27 22:25:09 +02:00
``cxx_default_function_template_args``
Default template arguments for function templates, as defined in DR226_
2022-11-16 20:14:03 +01:00
.. _DR226: https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
2015-04-27 22:25:09 +02:00
``cxx_defaulted_functions``
Defaulted functions, as defined in N2346_.
2022-11-16 20:14:03 +01:00
.. _N2346: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
2015-04-27 22:25:09 +02:00
``cxx_defaulted_move_initializers``
Defaulted move initializers, as defined in N3053_.
2022-11-16 20:14:03 +01:00
.. _N3053: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
2015-04-27 22:25:09 +02:00
``cxx_delegating_constructors``
Delegating constructors, as defined in N1986_.
2022-11-16 20:14:03 +01:00
.. _N1986: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
2015-04-27 22:25:09 +02:00
``cxx_deleted_functions``
Deleted functions, as defined in N2346_.
2022-11-16 20:14:03 +01:00
.. _N2346: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
2015-04-27 22:25:09 +02:00
``cxx_enum_forward_declarations``
Enum forward declarations, as defined in N2764_.
2022-11-16 20:14:03 +01:00
.. _N2764: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
2015-04-27 22:25:09 +02:00
``cxx_explicit_conversions``
Explicit conversion operators, as defined in N2437_.
2022-11-16 20:14:03 +01:00
.. _N2437: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
2015-04-27 22:25:09 +02:00
``cxx_extended_friend_declarations``
Extended friend declarations, as defined in N1791_.
2022-11-16 20:14:03 +01:00
.. _N1791: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
2015-04-27 22:25:09 +02:00
``cxx_extern_templates``
Extern templates, as defined in N1987_.
2022-11-16 20:14:03 +01:00
.. _N1987: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
2015-04-27 22:25:09 +02:00
``cxx_final``
Override control ``final`` keyword, as defined in N2928_, N3206_ and N3272_.
2022-11-16 20:14:03 +01:00
.. _N2928: https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
.. _N3206: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
.. _N3272: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
2015-04-27 22:25:09 +02:00
``cxx_func_identifier``
Predefined ``__func__`` identifier, as defined in N2340_.
2022-11-16 20:14:03 +01:00
.. _N2340: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
2015-04-27 22:25:09 +02:00
``cxx_generalized_initializers``
Initializer lists, as defined in N2672_.
2022-11-16 20:14:03 +01:00
.. _N2672: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
2015-04-27 22:25:09 +02:00
``cxx_inheriting_constructors``
Inheriting constructors, as defined in N2540_.
2022-11-16 20:14:03 +01:00
.. _N2540: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
2015-04-27 22:25:09 +02:00
``cxx_inline_namespaces``
Inline namespaces, as defined in N2535_.
2022-11-16 20:14:03 +01:00
.. _N2535: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
2015-04-27 22:25:09 +02:00
``cxx_lambdas``
Lambda functions, as defined in N2927_.
2022-11-16 20:14:03 +01:00
.. _N2927: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf
2015-04-27 22:25:09 +02:00
``cxx_local_type_template_args``
Local and unnamed types as template arguments, as defined in N2657_.
2022-11-16 20:14:03 +01:00
.. _N2657: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
2015-04-27 22:25:09 +02:00
``cxx_long_long_type``
``long long`` type, as defined in N1811_.
2022-11-16 20:14:03 +01:00
.. _N1811: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
2015-04-27 22:25:09 +02:00
``cxx_noexcept``
Exception specifications, as defined in N3050_.
2022-11-16 20:14:03 +01:00
.. _N3050: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
2015-04-27 22:25:09 +02:00
``cxx_nonstatic_member_init``
Non-static data member initialization, as defined in N2756_.
2022-11-16 20:14:03 +01:00
.. _N2756: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
2015-04-27 22:25:09 +02:00
``cxx_nullptr``
Null pointer, as defined in N2431_.
2022-11-16 20:14:03 +01:00
.. _N2431: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
2015-04-27 22:25:09 +02:00
``cxx_override``
Override control ``override`` keyword, as defined in N2928_, N3206_
and N3272_.
2022-11-16 20:14:03 +01:00
.. _N2928: https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
.. _N3206: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
.. _N3272: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
2015-04-27 22:25:09 +02:00
``cxx_range_for``
Range-based for, as defined in N2930_.
2022-11-16 20:14:03 +01:00
.. _N2930: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
2015-04-27 22:25:09 +02:00
``cxx_raw_string_literals``
Raw string literals, as defined in N2442_.
2022-11-16 20:14:03 +01:00
.. _N2442: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
2015-04-27 22:25:09 +02:00
``cxx_reference_qualified_functions``
Reference qualified functions, as defined in N2439_.
2022-11-16 20:14:03 +01:00
.. _N2439: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
2015-04-27 22:25:09 +02:00
``cxx_right_angle_brackets``
Right angle bracket parsing, as defined in N1757_.
2022-11-16 20:14:03 +01:00
.. _N1757: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
2015-04-27 22:25:09 +02:00
``cxx_rvalue_references``
R-value references, as defined in N2118_.
2022-11-16 20:14:03 +01:00
.. _N2118: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
2015-04-27 22:25:09 +02:00
``cxx_sizeof_member``
Size of non-static data members, as defined in N2253_.
2022-11-16 20:14:03 +01:00
.. _N2253: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
2015-04-27 22:25:09 +02:00
``cxx_static_assert``
Static assert, as defined in N1720_.
2022-11-16 20:14:03 +01:00
.. _N1720: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
2015-04-27 22:25:09 +02:00
``cxx_strong_enums``
Strongly typed enums, as defined in N2347_.
2022-11-16 20:14:03 +01:00
.. _N2347: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
2015-04-27 22:25:09 +02:00
``cxx_thread_local``
Thread-local variables, as defined in N2659_.
2022-11-16 20:14:03 +01:00
.. _N2659: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
2015-04-27 22:25:09 +02:00
``cxx_trailing_return_types``
Automatic function return type, as defined in N2541_.
2022-11-16 20:14:03 +01:00
.. _N2541: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
2015-04-27 22:25:09 +02:00
``cxx_unicode_literals``
Unicode string literals, as defined in N2442_.
2022-11-16 20:14:03 +01:00
.. _N2442: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
2015-04-27 22:25:09 +02:00
``cxx_uniform_initialization``
2016-07-09 11:21:54 +02:00
Uniform initialization, as defined in N2640_.
2015-04-27 22:25:09 +02:00
2022-11-16 20:14:03 +01:00
.. _N2640: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf
2015-04-27 22:25:09 +02:00
``cxx_unrestricted_unions``
Unrestricted unions, as defined in N2544_.
2022-11-16 20:14:03 +01:00
.. _N2544: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
2015-04-27 22:25:09 +02:00
``cxx_user_literals``
User-defined literals, as defined in N2765_.
2022-11-16 20:14:03 +01:00
.. _N2765: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
2015-04-27 22:25:09 +02:00
``cxx_variadic_macros``
Variadic macros, as defined in N1653_.
2022-11-16 20:14:03 +01:00
.. _N1653: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
2015-04-27 22:25:09 +02:00
``cxx_variadic_templates``
Variadic templates, as defined in N2242_.
2022-11-16 20:14:03 +01:00
.. _N2242: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
2015-04-27 22:25:09 +02:00
2021-09-14 00:13:48 +02:00
Individual features from C++ 14
"""""""""""""""""""""""""""""""
``cxx_aggregate_default_initializers``
Aggregate default initializers, as defined in N3605_.
2022-11-16 20:14:03 +01:00
.. _N3605: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3605.html
2021-09-14 00:13:48 +02:00
``cxx_attribute_deprecated``
``[[deprecated]]`` attribute, as defined in N3760_.
2022-11-16 20:14:03 +01:00
.. _N3760: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html
2021-09-14 00:13:48 +02:00
``cxx_binary_literals``
Binary literals, as defined in N3472_.
2022-11-16 20:14:03 +01:00
.. _N3472: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
2021-09-14 00:13:48 +02:00
``cxx_contextual_conversions``
Contextual conversions, as defined in N3323_.
2022-11-16 20:14:03 +01:00
.. _N3323: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf
2021-09-14 00:13:48 +02:00
``cxx_decltype_auto``
``decltype(auto)`` semantics, as defined in N3638_.
2022-11-16 20:14:03 +01:00
.. _N3638: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html
2021-09-14 00:13:48 +02:00
``cxx_digit_separators``
Digit separators, as defined in N3781_.
2022-11-16 20:14:03 +01:00
.. _N3781: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
2021-09-14 00:13:48 +02:00
``cxx_generic_lambdas``
Generic lambdas, as defined in N3649_.
2022-11-16 20:14:03 +01:00
.. _N3649: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html
2021-09-14 00:13:48 +02:00
``cxx_lambda_init_captures``
Initialized lambda captures, as defined in N3648_.
2022-11-16 20:14:03 +01:00
.. _N3648: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html
2021-09-14 00:13:48 +02:00
``cxx_relaxed_constexpr``
Relaxed constexpr, as defined in N3652_.
2022-11-16 20:14:03 +01:00
.. _N3652: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
2021-09-14 00:13:48 +02:00
``cxx_return_type_deduction``
Return type deduction on normal functions, as defined in N3386_.
2022-11-16 20:14:03 +01:00
.. _N3386: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3386.html
2021-09-14 00:13:48 +02:00
``cxx_variable_templates``
Variable templates, as defined in N3651_.
2022-11-16 20:14:03 +01:00
.. _N3651: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3651.pdf