Refactoring in commit bff468c988 (cmFileCommand: Use cm::optional for
keyword argument presence, 2022-06-30, v3.25.0-rc1~512^2) accidentally
broke the check that the input argument is either `INPUT` or `CONTENT`.
The check is supposed to fail when arguments are passed in the wrong
order. For example:
file(GENERATE OUTPUT ...
TARGET <target>
CONTENT <content>)
Prior to this fix, the input method would be CONTENT, but because the
first parsed keyword is not `CONTENT`, `inputIsContent` would be false.
The first parsed keyword isn't INPUT either, so we would not continue
into the error condition. CMake would then try to handle this as an
input file, when there isn't one, resulting in uninitialized memory
usage and segfaults or corruption later on.
Fixes: #25169
be53c75852 cmExperimental: recycle the C++ modules API UUID
deb1c3cbd5 cmCoreTryCompile: forward module-related binutils variables
b768d293c5 cmCoreTryCompile: use the source type context for source files
93993c7ad4 cmArgumentParser: support storing a context value with parsing
c9ca5f6326 cmCoreTryCompile: parse `SOURCES_TYPE` argument
07551f35de cmCoreTryCompile: use `target_sources` for `try_compile` targets
aad9033b56 cmExperimental: support forwarding associated variables to `try_compile`
f6cf433256 cmExperimental: only forward C++ module support to non-ABI checks
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8639
Since commit df58dbb0e9 (VS: Add CMake input files to ZERO_CHECK,
2023-03-19, v3.27.0-rc1~157^2), projects that specify the same file both
as input to `configure_file` and as the `MAIN_DEPENDENCY` of a custom
command fail to configure. Revert the change pending further
investigation. Add a test case demonstrating the problem.
Issue: #24557Fixes: #25149
After b665966933 (cmComputeLinkInformation: track `OBJECT` library
dependencies, 2023-07-22), introduced in !8645 as a fix for #25112,
`OBJECT` libraries were tracked in a separate member to reduce the risk
of further regressions. This commit prepares consumers to handle
`OBJECT` libraries once they start appearing as link items.
09b7ac7f67 strings: use single characters where possible
6aa9023700 string_view: use string_view literals in comparisons
1b60137b98 strings: combine string literals
e1b70d7286 cmCPackDragNDropGenerator: use a string instead of a stream for commands
f5d04b5bf0 cmStrCat: use where possible in Apple-specific sources
3af822cd8f cmXCode21Object: simplify streaming expression
c4f751604b cmLocalXCodeGenerator: return a default string
ce549909fb cmCPackPKGGenerator: remove unnecessary `.c_str()` calls
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8660
This allows for parsing of contextual keywords. For example:
```
some_command(
ARG_WITH_CONTEXT foo
CONTEXT bar
ARG_WITH_CONTEXT quux)
```
will be able to store that `foo` happened without context (or, rather,
its default value) and `quux` was provided in a `bar` context.