summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-08 13:25:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-08 13:25:19 (GMT)
commit130c9889825f06dacb3453f6ee6ebc3b7e3d914a (patch)
treede007cc6f9022c5a8517cd3203a68bb951a2b848
parent402b9cdbb7606409a20bdd12c4e0837853ba7b02 (diff)
parentfbda79f39d3bab2ccf508ee328cf59d6e6d6c217 (diff)
downloadCMake-130c9889825f06dacb3453f6ee6ebc3b7e3d914a.zip
CMake-130c9889825f06dacb3453f6ee6ebc3b7e3d914a.tar.gz
CMake-130c9889825f06dacb3453f6ee6ebc3b7e3d914a.tar.bz2
Merge topic 'doc-lang-std-features' into release-3.23
fbda79f39d Help: Document explicitly that 'cxx_std_##' features may not add a flag Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: antmak <antmak.pub@gmail.com> Merge-request: !7043
-rw-r--r--Help/manual/cmake-compile-features.7.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt7
5 files changed, 15 insertions, 0 deletions
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 67b0f6e..8073511 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -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
-----------------------------------
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index 3a17973..d93a9c1 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -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
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index 1a913fb..6846850 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
index 97da697..7aca9e8 100644
--- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt b/Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt
new file mode 100644
index 0000000..0de2d3d
--- /dev/null
+++ b/Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt
@@ -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.