diff options
author | FeRD (Frank Dana) <ferdnyc@gmail.com> | 2023-08-30 18:37:13 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2023-09-01 11:28:56 (GMT) |
commit | bbf3ed54229719c363f39eebf0deadecb775d3ee (patch) | |
tree | 868ccc2ba5470d5302599f888e24f6f4a501baab /Help/command | |
parent | 2f319c6484a997ca957b9ca25dd69ca52ba97de5 (diff) | |
download | CMake-bbf3ed54229719c363f39eebf0deadecb775d3ee.zip CMake-bbf3ed54229719c363f39eebf0deadecb775d3ee.tar.gz CMake-bbf3ed54229719c363f39eebf0deadecb775d3ee.tar.bz2 |
Help: Explain block() policy-scope rules more clearly
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/block.rst | 3 | ||||
-rw-r--r-- | Help/command/cmake_policy.rst | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Help/command/block.rst b/Help/command/block.rst index a352e83..4c6e111 100644 --- a/Help/command/block.rst +++ b/Help/command/block.rst @@ -21,7 +21,8 @@ scopes created by the ``block()`` command are removed. ``POLICIES`` Create a new policy scope. This is equivalent to - :command:`cmake_policy(PUSH)`. + :command:`cmake_policy(PUSH)` with an automatic + :command:`cmake_policy(POP)` when leaving the block scope. ``VARIABLES`` Create a new variable scope. diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst index dff6c3c..4a08c01 100644 --- a/Help/command/cmake_policy.rst +++ b/Help/command/cmake_policy.rst @@ -107,11 +107,10 @@ Calls to the :command:`cmake_minimum_required(VERSION)`, influence only the current top of the policy stack. .. versionadded:: 3.25 - The :command:`block` and :command:`endblock` commands offer a more flexible + The :command:`block(SCOPE_FOR POLICIES)` command offers a more flexible and more secure way to manage the policy stack. The pop action is done - automatically when the :command:`endblock` command is executed, so it avoid - to call the :command:`cmake_policy(POP)` command before each - :command:`return` command. + automatically when leaving the block scope, so there is no need to + precede each :command:`return` with a call to :command:`cmake_policy(POP)`. .. code-block:: cmake |