Commit Graph
13956 Commits
Author SHA1 Message Date
Brad King fa201d3cff Tests: Fix cmake --trace=json-v1 test expectation for integer time
Extend the `time` field check from commit c829f0cfca (trace: Add time
and stack level to JSON output format, 2020-01-20, v3.17.0-rc1~105^2) to
accept a timestamp that happens to be formatted as an exact integer.
2026-07-02 08:07:40 -04:00
Brad King db58e5fbd6 Merge topic 'compile-trace-rsp'
89b1e21a5e instrumentation: Gather compile trace files in compile rsp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12238
2026-07-02 08:03:06 -04:00
Brad King f2001c745f Merge topic 'target-types'
f1d7bedc4b TargetTypes: Improve use of imported target scope type
a5a9ec9113 TargetTypes: Extract target-related types to dedicated header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12236
2026-07-02 08:00:51 -04:00
Brad King e037d3bd2b Merge topic 'xc_cmd_comment'
de28f37ce4 Xcode: Propagate add_custom_command COMMENT to generated projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12237
2026-07-02 07:58:02 -04:00
Matthew Woehlke a5a9ec9113 TargetTypes: Extract target-related types to dedicated header
Move some target related enumeration types from `cmStateTypes.h` to a
new header, as these really aren't "state" types. Also, make
`TargetType` a strongly-typed enumeration.
2026-07-01 14:44:11 -04:00
Martin Duffy 89b1e21a5e instrumentation: Gather compile trace files in compile rsp
Updates instrumentation logic for gathering compile trace files to parse
compiler options in a response file for the presence of `-ftime-trace=...`.
2026-07-01 12:52:15 -04:00
Anton Tokar de28f37ce4 Xcode: Propagate add_custom_command COMMENT to generated projects
Propagate the COMMENT section of add_custom_command(OUTPUT) as Xcode
Build Phase, if present. Otherwise fallback to the current behavior

Fixes: #27910
2026-07-01 12:10:03 -04:00
Brad King 1fde7f4599 Merge topic 'install-exit-code-fidelity'
ae5f506906 Install: Exit non-zero when an install script fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12227
2026-07-01 09:54:52 -04:00
Brad King 8b8ffdb35d Merge topic 'cps-export-file-sets'
a5b38fb898 CPS: Implement exporting of file sets
8d229ec702 cmGeneratorFileSet: Support different mappings
c79c5aea4a CPS: Refactor getting file set destination for install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12226
2026-07-01 09:51:30 -04:00
Brad King 9883f84e8f Merge topic 'genex-list-sort-comparator'
4d86ef5e86 GenEx: add $<LIST:SORT,...,COMPARATOR,body> comparator
c418a3dc85 GenEx: factor out reusable SORT comparator and option-parsing helpers
e335872625 GenEx: generalize bound operands to a frame and add $<_1>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12228
2026-07-01 09:46:35 -04:00
Brad King 28ce1b8bc3 Merge topic 'test-out-of-date'
e11b5827c3 ctest: Add --out-of-date option for running out of date tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12180
2026-07-01 09:45:18 -04:00
Brad King c954e11ade Merge topic 'Target-file_set-introspection-properties'
08855d03c2 Add target properties to discover target's file set information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12224
2026-07-01 09:40:58 -04:00
Brad King b2d7c9a1f0 Merge topic 'update-curl'
d781e3b477 Tests: Update https-is-disabled error message for curl 8.21
b5b8651a68 curl: Set build options the way we need for CMake
0ac4d03eca Merge branch 'upstream-curl' into update-curl
ecbccb29a7 curl 2026-06-24 (68720b48)
25d2d31002 curl: Update script to get curl 8.21.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12230
2026-07-01 09:39:09 -04:00
Brad King a5f4e2a461 Merge topic 'test-bootstrap-args'
1853cd2bc1 Tests: Add option to control bootstrap arguments in BootstrapTest
da073c667f ci: Update name of option to skip BootstrapTest

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12234
2026-07-01 09:27:39 -04:00
Matthew Woehlke a5b38fb898 CPS: Implement exporting of file sets
Add (partial) file set export to CPS. For now, only headers ("includes")
are supported, as that is the only overlap with the specification.
(Source file sets are not supported by CPS at this time, and the hope is
that C++ modules will never be supported, as that information should
already be available via the `cpp_module_metadata` information.) CPS
also supports "embeds", but CMake doesn't (yet).

This also introduces our first official use of CPS extensions, used to
record the CMake file set name.
2026-06-30 15:08:02 -04:00
Daksh Mamodiya ae5f506906 Install: Exit non-zero when an install script fails
`cmake --install` did not propagate per-script failures into its
process exit code.

In parallel mode, cmInstallScriptHandler::Install spawned each install
script as a child process but never inspected the child exit status or
termination signal, and always returned 0.  It now reads each child's
status after the event loop, prints the failing script's exit code or
signal, and returns non-zero if any script failed.  A failed parallel
install also no longer writes the combined install_manifest.txt, so a
partial manifest is not mistaken for a complete install.

In serial mode, GetScripts() returns the top-level cmake_install.cmake
once per component and per configuration, so multiple scripts run only
when installing several components or configurations at once.  The loop
overwrote its result on every iteration, so an earlier script that
failed via cmake_language(EXIT) was masked by a later one that
succeeded.  The loop now stops at the first failure.  This is a no-op
for a single component and configuration; it changes only installs of
multiple components or configurations, which now stop at the first
failed script and report it instead of attempting the rest.

Fixes: #27906
2026-06-30 18:06:50 +02:00
Martin Duffy e11b5827c3 ctest: Add --out-of-date option for running out of date tests
Add an --out-of-date option to ctest which runs only those tests with
recorded build dependencies whose timestamps are newer than the timestamp
at which the test last finished.

Fixes: #27614
2026-06-30 11:31:35 -04:00
Mickaël Germain 4d86ef5e86 GenEx: add $<LIST:SORT,...,COMPARATOR,body> comparator
Add a COMPARATOR form to $<LIST:SORT> that orders the list by a caller-defined
rule: a <body> evaluated per comparison with the two elements bound to $<_0>
and $<_1>, yielding "1" when the first should sort before the second.  This
brings the custom ordering of list(SORT ... COMPARATOR) to generate time, so
elements can be ordered by target properties or any other generator expression.
CASE: and ORDER: still apply, while COMPARE: is rejected because the body
defines the ordering.

Fixes: #27892
2026-06-30 08:19:41 -07:00
Mickaël Germain e335872625 GenEx: generalize bound operands to a frame and add $<_1>
Allow a binding operation to bind more than one operand at once, exposed as
$<_0>, $<_1>, ....  A single value remains the common case, but the upcoming
SORT COMPARATOR must bind the two elements being compared, so the binding
becomes an indexed frame and $<_1> is added.  Referencing an index the active
binding does not provide is reported as an error.

Issue: #27892
2026-06-30 08:19:41 -07:00
Brad King bce2b06a6e Merge topic 'FindPkgConfig-batch'
660684c333 FindPkgConfig: Batch pkg-config flag queries
9555f80ea8 FindPkgConfig: Tolerate include directory order in test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12204
2026-06-30 11:11:43 -04:00
Brad King d5d4eb2991 Merge topic 'sarif-diagnostics'
1c3d648fc5 cmSarif: Classify results by diagnostic category
4cc948ad08 cmSarif: Improve conformance with SARIF in CMake result reporting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12191
2026-06-30 11:10:18 -04:00
Brad King be33dbe421 Merge topic 'changing-toolchain'
7a989ed58a CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12211
2026-06-30 11:08:58 -04:00
Brad King 00538bfea0 Merge topic 'correct_rpaths_no_matter_sysroot'
b6d3e9ba18 RPATH: Support CMAKE_SYSROOT value of `/`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12221
2026-06-30 11:06:21 -04:00
Brad King d781e3b477 Tests: Update https-is-disabled error message for curl 8.21 2026-06-30 10:32:54 -04:00
Marc Chevrier 08855d03c2 Add target properties to discover target's file set information
Currently, target properties related to file sets are specific to file set
type (for example "SOURCE_SETS"). This raises some concerns:
1. For each new file set type, 6 new properties are created which need a lot
   off documentation update
2. there is no "generic" way to discover file sets information

The new target properties (FILE_SET_TYPES, FILE_SETS_<TYPE>,
and INTERFACE_FILE_SETS_<TYPE>), in conjunction with the file sets
properties, enable a complete generic file sets information discovery.
2026-06-30 16:03:32 +02:00
Brad King 1853cd2bc1 Tests: Add option to control bootstrap arguments in BootstrapTest
In some environments, `bootstrap` may need explicit arguments to work.
2026-06-30 09:32:33 -04:00
Volodymyr Zolotopupov 660684c333 FindPkgConfig: Batch pkg-config flag queries 2026-06-29 15:43:55 -04:00
Volodymyr Zolotopupov 9555f80ea8 FindPkgConfig: Tolerate include directory order in test 2026-06-29 15:43:55 -04:00
Daniel Tierney 1c3d648fc5 cmSarif: Classify results by diagnostic category
Add additional rules to CMake's SARIF reporting for diagnostic categories.

Fixes: #27883
2026-06-29 14:12:31 -04:00
Daniel Tierney 4cc948ad08 cmSarif: Improve conformance with SARIF in CMake result reporting
Reorganize CMake's SARIF implementation to clearly distinguish between the SARIF standard and CMake's result reporting structure, fixing several validation failures.
- Removed unused message strings in reported rules.
- Report artifact locations relative to the CMake home directory.
- Use the recommended schema URL.
- Stop reporting some invalid locations read from the top of the stack.

cmMessenger no longer manages a SARIF log but stores a list of displayed messages. The SARIF log is constructed from displayed messages upon writing the file.
2026-06-29 14:12:31 -04:00
Aiden Woodruff 7a989ed58a CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache
If the path to the toolchain file changes then anything in the cache
that's derived from the toolchain may need to be recomputed.  Detect
this case and start a fresh build.

Issue: #27867
Signed-off-by: Aiden Woodruff <aiden.woodruff@kitware.com>
2026-06-29 12:09:16 -04:00
Brad King 4933a2de10 Merge topic 'testprep-makefile-generators'
503bdb9777 Makefile: Generate test_prep targets for CMAKE_TEST_BUILD_DEPENDS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12214
2026-06-29 11:59:57 -04:00
Brad King 5e6410b97e Merge topic 'genex-list-filter-transform-predicate'
0b5a172c22 Help: hyperlink $<_0> and configure-time commands in $<LIST> docs
092edb6860 GenEx: add $<LIST:FILTER> PREDICATE filter and REGEX keyword
d2ad140ef9 GenEx: add PREDICATE selector to $<LIST:TRANSFORM>
6024f624b0 GenEx: factor TRANSFORM action descriptor lookup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12213
2026-06-29 11:46:22 -04:00
Robert Maynard b6d3e9ba18 RPATH: Support CMAKE_SYSROOT value of /
Fixes: #27882
2026-06-25 13:53:08 -04:00
Brad King 944ff5e7aa Merge topic 'freebsd-get-runtime-dependencies'
ad0dfd51ba Tests: Enable some Linux cases on FreeBSD
144021a43b file(GET_RUNTIME_DEPENDENCIES): Implement command for FreeBSD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12192
2026-06-25 07:33:06 -04:00
Brad King df2bd0f771 Merge topic 'liblzma-arm64-bcj'
9a46155665 Tests: Cover ARM64 BCJ 7z extraction
8f94e20abc liblzma: Enable ARM64 BCJ filters in bundled build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12202
2026-06-25 07:27:33 -04:00
Brad King fe3be55d54 Merge topic 'check-tolerate-W-flags'
5abaf65154 Check*: Restore toleration of `;-W...` in CMAKE_REQUIRED_FLAGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12212
2026-06-25 07:25:38 -04:00
Brad King 8192c7dce1 Merge topic 'skip-toolchain-checks-more-variables'
170248fbcb CMakeDetermineCompilerABI: require more variables to skip checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12201
2026-06-25 07:22:31 -04:00
Matthew Woehlke 5abaf65154 Check*: Restore toleration of ;-W... in CMAKE_REQUIRED_FLAGS
The `CMAKE_REQUIRED_FLAGS` variable, used by the various entry points to
`cmake_check_source_{compiles,runs}`, specifies that flags shall not be
separated by semicolons. This is because the way in which it is passed
to the child `cmake` process means that, when considered as a list (with
semicolon separated items), only the first item is actually used as
compile flags, with any additional items actually seen as arguments to
the child `cmake` process. While this usage is unsupported, if invoked
accidentally, flags starting with `-W` were silently ignored by CMake.

However, CMake 4.4 newly complains about unrecognized warning
categories, which means that uses which were silently broken now result
in a hard error.

In the longer term, it would be helpful to introduce a policy to repair
improper use of semicolons in `CMAKE_REQUIRED_FLAGS` in order to do what
the user probably meant. However, for various reasons, we do not want to
introduce a policy to CMake 4.4 at this time, and anyway, the policy
won't help users that haven't enabled it. Therefore, alter the 'check
source' functions to detect arguments being passed to `cmake` rather
than the compiler, and remove any such that start with `-W`. This
removes any arguments that newly cause errors starting with CMake 4.4,
while not otherwise altering behavior in case any users were abusing
this implementation quirk.

Strictly speaking, this means that users can no longer abuse this quirk
to alter CMake's diagnostics. However, the only case in which this
should be observable is if the user is already abusing the quirk to
inject their own CMake logic into the CMake-provided test projects.
Since this was never supported, anyone doing that can keep the pieces.

Issue: #27901
Fixes: #27893
2026-06-24 13:59:11 -04:00
Gleb Popov ad0dfd51ba Tests: Enable some Linux cases on FreeBSD 2026-06-24 18:51:49 +03:00
Gleb Popov 144021a43b file(GET_RUNTIME_DEPENDENCIES): Implement command for FreeBSD
Closes: #25305
2026-06-24 18:49:51 +03:00
Ben Boeckel 170248fbcb CMakeDetermineCompilerABI: require more variables to skip checks
These variables were missed in the addition of the feature.

Fixes: #27894
2026-06-24 11:38:50 -04:00
Daksh Mamodiya 503bdb9777 Makefile: Generate test_prep targets for CMAKE_TEST_BUILD_DEPENDS
Extend the test_prep/<test> and test_prep/all build targets, generated
from add_test(BUILD_DEPENDS) when CMAKE_TEST_BUILD_DEPENDS is enabled, to
the Makefile generators.  Previously only the Ninja and FASTBuild
generators provided them.

Resolve each test's dependencies in a shared layer so all command-line
generators consume one result.  cmTestGenerator now filters target
dependencies to build-system targets and records, for each file
dependency, the single target that produces it as a primary
custom-command output (cmGlobalGenerator::FindOutputOwningTarget).  The
Makefile generators emit phony rules in CMakeFiles/Makefile2 depending on
<target>.dir/all, with top-level forwarding rules.  Sharing the
resolution also stops Ninja and FASTBuild from emitting a dead test_prep
edge for a non-buildable (e.g. INTERFACE) BUILD_DEPENDS target.

On the Makefile generators a file dependency that no single target
produces, and a test whose name contains ':', cannot be expressed as a
recursive-make rule and are reported with a warning and skipped.

Fixes: #27879
2026-06-24 17:24:54 +02:00
NihilDigit 9a46155665 Tests: Cover ARM64 BCJ 7z extraction
Add a small 7z fixture whose filter chain is ARM64 BCJ followed by
LZMA2.  This exercises extraction through CMake's bundled libarchive
and liblzma path.

The fixture was generated with 7-Zip 25.01 (arm64).  The payload is a
16-byte AArch64 instruction sequence:

  1f2003d500000094000000141f2003d5

The payload mtime was set to 2026-06-21T00:00:00Z and then archived
with:

  7z a -m0=ARM64 -m1=LZMA2 -mb0:1 -mtm=on -mtc=off -mta=off \
    7zip-arm64-bcj.7z payload.bin

The resulting 7zip-arm64-bcj.7z has SHA256:

  3DE9111E71C6AA3CBD604460040EBBE6F57E8B00D1D5C5343AC07D435AA2A8D2
2026-06-24 10:18:49 -04:00
Brad King 23c5b40924 Merge topic 'fastbuild-test-deps'
2d417b9371 FASTBuild: Generate test_prep/ targets for test build dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12183
2026-06-24 09:54:39 -04:00
Brad King 84e1dbc893 Merge topic 'fileapi-import-std-target-refs'
11c93dd6da fileapi: Test import std target references in codemodel

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12209
2026-06-24 09:52:25 -04:00
Brad King 741c67a43c Merge topic 'fileapi-toolchains-none'
a3b5591bbc fileapi: Omit NONE language entries from toolchains

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12206
2026-06-24 09:51:11 -04:00
Brad King 4073b18ab7 Merge topic 'source_group-FILE_SET-support'
6043014d1d source_group(): Add file set support
44fd6ec551 source_group: use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12195
2026-06-24 09:49:49 -04:00
Brad King f98ff30970 Merge topic 'tests-split-runcmake-install'
e5e4616a56 Tests/RunCMake/install: split into variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12194
2026-06-24 09:36:28 -04:00
Mickaël Germain 092edb6860 GenEx: add $<LIST:FILTER> PREDICATE filter and REGEX keyword
Let $<LIST:FILTER> select elements by an arbitrary condition: PREDICATE keeps or
drops each element according to a <body> evaluated with $<_0> bound,
complementing the existing regular-expression form.  Also accept an explicit
REGEX keyword before the pattern so the regex and predicate forms read
symmetrically; the bare pattern keeps working.

Issue: #27892
2026-06-23 21:31:49 -07:00