summaryrefslogtreecommitdiffstats
path: root/Help/policy
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-04 18:20:50 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-04 18:55:12 (GMT)
commit30313aa72166ef06cde8c64ab1e582f8a242502e (patch)
treedce3c7dbe42dc55cd68912e8efe338f498dacb2e /Help/policy
parent8895284e115648ecfed020af2e55403341f3dd76 (diff)
downloadCMake-30313aa72166ef06cde8c64ab1e582f8a242502e.zip
CMake-30313aa72166ef06cde8c64ab1e582f8a242502e.tar.gz
CMake-30313aa72166ef06cde8c64ab1e582f8a242502e.tar.bz2
while: diagnose errors during condition evaluation
Add a policy to diagnose condition errors in a compatible way. Fixes: #23296
Diffstat (limited to 'Help/policy')
-rw-r--r--Help/policy/CMP0130.rst32
1 files changed, 32 insertions, 0 deletions
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