summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-07 14:59:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-07 14:59:34 (GMT)
commit5f7f9faada87134d60e63fb5d263d3c003889ffd (patch)
tree16882fe96c577cd5d19a308b027c42ec1d0316b3 /Help
parent3df1f7ef71679a92fb605dec8ff18f09ccc716af (diff)
parent30313aa72166ef06cde8c64ab1e582f8a242502e (diff)
downloadCMake-5f7f9faada87134d60e63fb5d263d3c003889ffd.zip
CMake-5f7f9faada87134d60e63fb5d263d3c003889ffd.tar.gz
CMake-5f7f9faada87134d60e63fb5d263d3c003889ffd.tar.bz2
Merge topic 'while-errors'
30313aa721 while: diagnose errors during condition evaluation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7045
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst8
-rw-r--r--Help/policy/CMP0130.rst32
-rw-r--r--Help/release/dev/while-errors.rst5
3 files changed, 45 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0939a82..dfc5de6 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -52,6 +52,14 @@ to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.24
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0130: while() diagnoses condition evaluation errors. </policy/CMP0130>
+
Policies Introduced by CMake 3.23
=================================
diff --git a/Help/policy/CMP0130.rst b/Help/policy/CMP0130.rst
new file mode 100644
index 0000000..0dd5623
--- /dev/null
+++ b/Help/policy/CMP0130.rst
@@ -0,0 +1,32 @@
+CMP0130
+-------
+
+.. versionadded:: 3.24
+
+:command:`while` diagnoses condition evaluation errors.
+
+CMake 3.23 and below accidentally tolerated errors encountered while
+evaluating the condition passed to the :command:`while` command
+(but not the :command:`if` command). For example, the code
+
+.. code-block:: cmake
+
+ set(paren "(")
+ while(${paren})
+ endwhile()
+
+creates an unbalanced parenthesis during condition evaluation.
+
+CMake 3.24 and above prefer to diagnose such errors. This policy
+provides compatibility for projects that have not been updated to
+fix their condition errors.
+
+The ``OLD`` behavior for this policy is to ignore errors in
+:command:`while` conditions. The ``NEW`` behavior for this
+policy is to diagnose errors in :command:`while` conditions.
+
+This policy was introduced in CMake version 3.24. CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/while-errors.rst b/Help/release/dev/while-errors.rst
new file mode 100644
index 0000000..c39e6e8
--- /dev/null
+++ b/Help/release/dev/while-errors.rst
@@ -0,0 +1,5 @@
+while-errors
+------------
+
+* The :command:`while` command now diagnoses errors during condition
+ evaluation. See policy :policy:`CMP0130`.