diff options
author | Craig Scott <craig.scott@crascit.com> | 2024-08-18 12:38:02 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2024-08-22 23:42:13 (GMT) |
commit | ceeea4e511d658b249615e5c98231f070aaedeb9 (patch) | |
tree | 48623570bef921bf485136b33f64e404257eadc4 /Source/cmPolicies.h | |
parent | 2f5cc6afa1f9561783193c4541bf1149b3f63fa8 (diff) | |
download | CMake-ceeea4e511d658b249615e5c98231f070aaedeb9.zip CMake-ceeea4e511d658b249615e5c98231f070aaedeb9.tar.gz CMake-ceeea4e511d658b249615e5c98231f070aaedeb9.tar.bz2 |
cmake_parse_arguments: Set variable if empty string given after keyword
If a single-value keyword is followed by an empty string, the
command unsets the variable for that keyword instead of setting
it to the empty string. This is inconsistent and unexpected. Add
policy CMP0174 which ensures the variable for a single-value
keyword is always set when any value is given, not just for a
non-empty value.
The new CMP0174 policy only affects the PARSE_ARGV form of
cmake_parse_arguments. The older form silently drops all empty
string arguments before processing the argument list.
Fixes: #25972
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r-- | Source/cmPolicies.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 2c3763f..7b056ae 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -533,7 +533,11 @@ class cmMakefile; "the CPack WIX Generator.", \ 3, 31, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0173, "The CMakeFindFrameworks module is removed.", 3, \ - 31, 0, cmPolicies::WARN) + 31, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0174, \ + "cmake_parse_arguments(PARSE_ARGV) defines a variable for an empty " \ + "string after a single-value keyword.", \ + 3, 31, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ |