summaryrefslogtreecommitdiffstats
path: root/Help/manual
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-05-29 15:34:18 (GMT)
committerRaul Tambre <raul@tambre.ee>2021-09-29 19:28:40 (GMT)
commit4a0485be7f4ab06201c478f5a46111ab1e8e773e (patch)
treea4a89916f051e70a7fac32fbba0daaefbcc4ac0d /Help/manual
parent29e2b8517126389b2c4b2f3479c4634a8260bea3 (diff)
downloadCMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.zip
CMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.tar.gz
CMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.tar.bz2
cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128. When the standard level is unset: * Flags are added if extension mode doesn't match the compiler's default. Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224. * The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was used. This was only supported for IAR. Otherwise: * Avoid adding flags if not necessary per the detected compiler defaults. * Fixed check for when the requested standard is older. It now matches the nearby comments. I reworded the fallback comment as its logic was a bit difficult to wrap my head around.
Diffstat (limited to 'Help/manual')
-rw-r--r--Help/manual/cmake-compile-features.7.rst11
-rw-r--r--Help/manual/cmake-policies.7.rst1
2 files changed, 6 insertions, 6 deletions
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 2b0de11..a0459fa 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -118,14 +118,13 @@ as well as any dependents (that may include headers from ``mylib``).
Availability of Compiler Extensions
-----------------------------------
-Because the :prop_tgt:`CXX_EXTENSIONS` target property is ``ON`` by default,
-CMake uses extended variants of language dialects by default, such as
-``-std=gnu++11`` instead of ``-std=c++11``. That target property may be
-set to ``OFF`` to use the non-extended variant of the dialect flag. Note
-that because most compilers enable extensions by default, this could
-expose cross-platform bugs in user code or in the headers of third-party
+The :prop_tgt:`<LANG>_EXTENSIONS` target property defaults to the compiler's
+efault. Note that because most compilers enable extensions by default, this
+may expose cross-platform bugs in user code or in the headers of third-party
dependencies.
+:prop_tgt:`<LANG>_EXTENSIONS` used to default to ``ON``. See :policy:`CMP0128`.
+
Optional Compile Features
=========================
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0f0c0ab..3df4f9f 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.22
.. toctree::
:maxdepth: 1
+ CMP0128: Selection of language standard and extension flags improved. </policy/CMP0128>
CMP0127: cmake_dependent_option() supports full Condition Syntax. </policy/CMP0127>
Policies Introduced by CMake 3.21