0a0bdaecdf ci: Update Windows packaging jobs to VS 20206
d54e15a5b8 ci: Require Windows 10 in official precompiled binaries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11496
Exclude infrastructure added by commit 61743471d9 (ast-grep: add a rule
to find adjacent string literals in cmStrCat calls, 2025-05-15,
v4.1.0-rc1~122^2~3).
Previously, `cmPackageInfoReader` made the wildly optimistic assumption
that it will know how to read any CPS version that is less than 1.0
(note, the current version as of writing is 0.13). This is likely not a
safe assumption. Assume instead that we only know how to read the
current minor version, i.e. 0.13.x. This still allows room for the
specification to make non-breaking changes, while also providing a
better path for making breaking changes without CMake wrongly thinking
it still understands what it's reading.
Typos in commit 9ba0a54554 (TIClang: Add support for TI Clang-based
compilers, including tiarmclang, 2023-12-06, v3.29.0-rc1~4^2~1)
left the flags unused. In particular, `CMAKE_<LANG>_LINKER_FLAGS`
does not exist.
Modify the `export(EXPORT)` and `install(PACKAGE_INFO)` commands to
actually enforce that certain arguments must be non-empty. With respect
to `export`, this is mainly targeted at CPS export, but ends up
affecting all flavors of `export(EXPORT)` because that is the level at
which argument parsing is performed.
Also, add unit tests to verify that the new rejection of arguments with
missing or empty values is working, update the existing tests due to
changes in error reporting, and remove no-longer-needed manual
validation of an empty `PACKAGE_INFO` argument.
Modify argument handling in `HandleExportMode` to explicitly allow an
empty `NAMESPACE`. In practice, this was already the case because we
weren't actually checking for the parsing errors that would cause the
`NonEmpty` decoration to reject an empty value, but we want to be able
to do that going forward, and changing the behavior for `NAMESPACE`
would potentially break legitimate uses. (In particular, one of our unit
tests relies on the current behavior.)
Tweak ArgumentParser::ParseResult to store errors as a set, rather than
concatenating them. Add a new method that a) also optionally checks for
unknown arguments, and b) reports errors using the `SetError` method of
`cmExecutionStatus`, which allows callers to `return false`, which is
less surprising when an error occurs. This improves consistency at call
sites, reduces duplication by moving the common task of complaining
about unknown arguments to a reusable method, and also produces somewhat
more concise messages in the case that multiple errors occurred.
Note that, for some reason, the parser is sometimes generating duplicate
errors, hence the use of a set rather than a list.