diff options
author | Brad King <brad.king@kitware.com> | 2022-07-01 12:24:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-07-01 12:24:36 (GMT) |
commit | 27a103e8bcf9c4bb864310dab656cd52160677c1 (patch) | |
tree | 7d76f1461ee05ed96f342bec20f6a6c72b02b53b /Source | |
parent | 45178d7f955a6dda44f1663019fbba17c5739932 (diff) | |
parent | 7c83265e594247013f4cba9b45c252a9425ad657 (diff) | |
download | CMake-27a103e8bcf9c4bb864310dab656cd52160677c1.zip CMake-27a103e8bcf9c4bb864310dab656cd52160677c1.tar.gz CMake-27a103e8bcf9c4bb864310dab656cd52160677c1.tar.bz2 |
Merge topic 'file-archive-args'
7c83265e59 file(ARCHIVE*): Simplify acceptance of empty list arguments
dfff470d15 file(ARCHIVE*): Add test for keyword arguments with missing values
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7427
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 7d05347..1cfe29c 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3113,6 +3113,7 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, return false; } + // Arguments that are allowed to be empty lists. Keep entries sorted! const std::vector<std::string> LIST_ARGS = { "DIRECTORIES", "EXECUTABLES", @@ -3402,8 +3403,13 @@ bool HandleArchiveCreateCommand(std::vector<std::string> const& args, return false; } + // Arguments that are allowed to be empty lists. Keep entries sorted! const std::vector<std::string> LIST_ARGS = { - "OUTPUT", "FORMAT", "COMPRESSION", "COMPRESSION_LEVEL", "MTIME", "PATHS" + "MTIME", // "MTIME" should not be in this list because it requires one + // value, but it has long been accidentally accepted without + // one and treated as if an empty value were given. + // Fixing this would require a policy. + "PATHS", // "PATHS" is here only so we can issue a custom error below. }; auto kwbegin = keywordsMissingValues.cbegin(); auto kwend = cmRemoveMatching(keywordsMissingValues, LIST_ARGS); @@ -3530,8 +3536,8 @@ bool HandleArchiveExtractCommand(std::vector<std::string> const& args, return false; } - const std::vector<std::string> LIST_ARGS = { "INPUT", "DESTINATION", - "PATTERNS" }; + // Arguments that are allowed to be empty lists. Keep entries sorted! + const std::vector<std::string> LIST_ARGS = { "PATTERNS" }; auto kwbegin = keywordsMissingValues.cbegin(); auto kwend = cmRemoveMatching(keywordsMissingValues, LIST_ARGS); if (kwend != kwbegin) { |