Help: Document explicitly that 'cxx_std_##' features may not add a flag

This is commonly reported incorrectly as a bug, so call out this
behavior explicitly in the documentation.
This commit is contained in:
Brad King 2022-03-04 09:29:12 -05:00
parent 8074e46a5c
commit fbda79f39d
5 changed files with 15 additions and 0 deletions

View File

@ -115,6 +115,8 @@ of at-least C++ 11 (or C++ 14, C++ 17, ...), adding flags such as
``-std=gnu++11`` if necessary. This applies to sources within ``mylib``
as well as any dependents (that may include headers from ``mylib``).
.. include:: ../prop_gbl/CMAKE_LANG_STD_FLAGS.txt
Availability of Compiler Extensions
-----------------------------------

View File

@ -35,3 +35,5 @@ The features known to this version of CMake are:
.. versionadded:: 3.20
Compiler mode is at least CUDA/C++ 23.
.. include:: CMAKE_LANG_STD_FLAGS.txt

View File

@ -46,6 +46,8 @@ but it does not necessarily imply complete conformance to that standard.
Compiler mode is at least C++ 23.
.. include:: CMAKE_LANG_STD_FLAGS.txt
Low level individual compile features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -39,6 +39,8 @@ High level meta features indicating C standard support
Compiler mode is at least C 23.
.. include:: CMAKE_LANG_STD_FLAGS.txt
Low level individual compile features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -0,0 +1,7 @@
.. note::
If the compiler's default standard level is at least that
of the requested feature, CMake may omit the ``-std=`` flag.
The flag may still be added if the compiler's default extensions mode
does not match the :prop_tgt:`<LANG>_EXTENSIONS` target property,
or if the :prop_tgt:`<LANG>_STANDARD` target property is set.