Skip to content

file(ARCHIVE*): Simplify acceptance of empty list arguments

Brad King requested to merge brad.king/cmake:file-archive-args into master

In cmArgumentParser, a keyword bound to a std::vector<std::string> value is reported in the list of keywords with missing values if the keyword appears followed by an empty list. For cases where we want to tolerate empty lists, clients need to filter out such keywords themselves before producing an error message. This may be improved in the future, but that is out of scope here.

In !4475 (merged), a pattern for filtering out keywords that accept empty lists was copied from !4262 (merged) incorrectly in two ways:

  • Keywords were included in the filter that do not accept empty lists.
  • Keywords were not in sorted order, breaking the filter operation.

Those two bugs mostly canceled each other out, and the resulting behavior was to correctly report keywords with missing values. However, the MTIME keyword was accidentally accepted with no value by pretending the keyword was not given at all.

Simplify the logic by removing keywords from the filters that should not be there. Leave MTIME in the filter for compatibility.

Merge request reports