Commit Graph
13983 Commits
Author SHA1 Message Date
Brad King 0386638c20 Merge topic 'trace-ninja-dashc'
8d0615d579 Merge branch 'backport-trace-ninja-dashc' into trace-ninja-dashc
727522d835 instrumentation: Fully resolve compile trace path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12257
2026-07-09 13:19:09 -04:00
Brad King 4c0451ac95 Merge topic 'install-parallel-timestamp-jitter'
06fe796c9a install: Compare parallel index freshness at whole-second resolution

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12247
2026-07-09 10:08:14 -04:00
Brad King 0d9a4242e4 Merge topic 'alias-transparency'
17094eb572 ALIAS: Add test for generator expressions with ALIAS targets
5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
79e421b053 ALIAS: Add support for target_* commands
3b327695aa ALIASED_TARGET: Make property read-only
a121419908 ALIAS: Add support for set_property and set_target_properties commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12207
2026-07-09 10:06:32 -04:00
Brad King 2ae2165083 Merge topic 'fix-not-found-file-set-crash'
d9b9b4cd27 FileSets: Don't crash if a file's file set isn't found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12255
2026-07-09 09:56:40 -04:00
Brad King 8d0615d579 Merge branch 'backport-trace-ninja-dashc' into trace-ninja-dashc 2026-07-09 09:48:43 -04:00
Tyler Yankee 727522d835 instrumentation: Fully resolve compile trace path
When the build is invoked under the native build tool's (commonly
spelled) `-C` option to change from the current working directory to a
given build tree, the default path to a snippet's `-ftime-trace` file
under its corresponding target's object directory was incorrectly
stored based on the path from the working directory.
2026-07-09 09:43:18 -04:00
Daksh Mamodiya 06fe796c9a install: Compare parallel index freshness at whole-second resolution
The install handler runs `cmake --install -j` in parallel only when the
CMakeFiles/InstallScripts.json index is at least as new as
CMakeFiles/cmake.check_cache.  Both files are written during a single
generate step, so any ordering between them is sub-second.  On
filesystems that do not order two near-simultaneous writes by their
sub-second modification time (e.g. NFS on AIX), a fresh index can appear
older than the marker and the install spuriously falls back to serial.

Compare the two modification times at whole-second resolution.  This
ignores sub-second jitter within one generate step while still detecting
a genuinely stale index from an older CMake reconfigure, which is always
at least a configure run older.

Fixes: #27919
2026-07-08 19:40:45 +02:00
Matthew Woehlke d9b9b4cd27 FileSets: Don't crash if a file's file set isn't found
File sets currently have issues with files containing semicolons;
particularly, names get mangled differently in different contexts. This
can result in failing to find a file's file set. Prior to dee8799d16
(FileSet management: Introduce dedicated classes for generation,
2026-02-16, v4.4.0-rc1~691^2), we guarded against this, but the
aforementioned commit introduced code that would try to use the found
fileset object without checking if it was valid. Add the missing checks
so that we do not crash trying to dereference a null pointer. Also,
refactor `cmGeneratorTarget::GetSourceFilePaths` to avoid unnecessary
work.

Fixes: #27924
2026-07-08 12:30:17 -04:00
Arha Gatram 17094eb572 ALIAS: Add test for generator expressions with ALIAS targets
Generator expressions already correctly get properties of an ALIAS from
the referenced target. Adds a test to verify a more complicated case
that a generator expression set on an ALIAS target to a transitive
property that gets a property from the ALIAS evaluates correctly.
2026-07-08 11:51:52 -04:00
Arha Gatram 5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
The add_dependencies command currently accepts ALIAS targets for
<target-dependencies> which resolve to the referenced target. This further
relaxes the command to accept an ALIAS <target> where the command will
add the dependencies to the target which the alias references.
2026-07-08 11:51:51 -04:00
Arha Gatram 79e421b053 ALIAS: Add support for target_* commands
Now that set_property and set_target_properties support ALIAS targets,
we need to extend support to all the target_* type commands that modify
target properties.

Relaxes target_compile_definitions, target_compile_features,
target_compile_options, target_include_directories,
target_link_directories, target_link_libraries, target_link_options,
target_precompile_headers, and target_sources to now accept ALIAS
targets. These commands set properties on the target which the alias
references.
2026-07-08 11:51:50 -04:00
Brad King be81b4e20b Merge topic 'instrumentation-interrupt-install'
63e4a989e0 Instrumentation: Write cmakeInstall snippet on interrupted install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12250
2026-07-08 10:54:09 -04:00
Brad King ccfef28ee4 Merge topic 'ctest-launch-signal-passthrough'
899e7231ab CTest: Report failure when a launched command is killed by a signal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12248
2026-07-08 10:41:17 -04:00
Brad King e55cf93295 Merge topic 'remove-vs14-generator'
5b0aee4961 Drop Visual Studio 14 2015 generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12245
2026-07-08 09:29:06 -04:00
Brad King e81dc7020a Merge topic 'fix-cmp0194-policy-warning'
895f83d019 Merge branch 'backport-4.2-fix-cmp194-policy-warning'
e733da51ba CMP0194: Fix policy number in warning text
b88cade899 Merge branch 'backport-4.1-fix-cmp194-policy-warning'
26681a69d2 CMP0194: Fix policy number in warning text
2eb1361cc2 CMP0194: Fix policy number in warning text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12252
2026-07-08 09:19:52 -04:00
Jocó Mihalicza e733da51ba CMP0194: Fix policy number in warning text 2026-07-07 15:58:19 -04:00
Brad King 3df7dd2a12 Tests: Teach RunCMake.CompileWarningAsError to tolerate -w in environment 2026-07-07 15:50:24 -04:00
Brad King 04b2dfd8be Merge topic 'changing-toolchain-recover'
ca3d1007f0 Tests: Simplify RunCMake.CompilerChange
ca0bf9848d cmake: Retain cache from presets and command line before re-configure
ee6bfdc1f3 CMAKE_TOOLCHAIN_FILE: Improve recovery from changed compiler or toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12241
2026-07-07 11:12:13 -04:00
Brad King 3765645365 Merge topic 'ctest-stdio-colors'
fd395b25b5 ctest: Improve colorization in output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12243
2026-07-07 11:00:30 -04:00
Arha Gatram a121419908 ALIAS: Add support for set_property and set_target_properties commands
Currently, getting properties from an ALIAS target retrieves the property
from the target which the alias references while setting properties results
in an error. This relaxes set_property and set_target_properties to
accept ALIAS targets and act on the referenced target, mirroring the get
behavior.

An error is raised when setting ALIAS_GLOBAL or ALIASED_TARGET on an ALIAS
target.

Closes: #19445
2026-07-07 07:32:27 -07:00
Daksh Mamodiya 899e7231ab CTest: Report failure when a launched command is killed by a signal
cmCTestLaunch, which backs ctest --launch and ctest --instrument,
derived its exit code from the child's SpawnResult and ExitStatus but
ignored TermSignal.  On POSIX a command killed by a signal reports
ExitStatus 0 and TermSignal N, so the launcher reported success for a
crashed or killed command, masking failed compile/link/custom rules on
the dashboard and in instrumentation snippets.

Classify the child with the ordered triple SpawnResult, TermSignal,
ExitStatus, mapping a signal-killed child to a non-zero exit code.
Native Windows is unaffected: abnormal termination already arrives as a
non-zero exit code there.

Fixes: #27921
2026-07-06 15:46:37 +02:00
Daksh Mamodiya 63e4a989e0 Instrumentation: Write cmakeInstall snippet on interrupted install
With instrumentation enabled, interrupting `cmake --install` (Ctrl+C)
terminated the process before its overall `cmakeInstall` envelope
snippet was written, orphaning the per-script `install` snippets.

Extend the `cmake --build` interrupt handling to the install site: wrap
the `cmakeInstall` command in `HandleInterrupt`, skip the post-install
hook, and re-raise so the exit status reflects the signal.  Add
cooperative cancellation so the command unwinds -- serial-loop and
parallel `queueScripts` guards stop launching further scripts, and the
parallel failure aggregation is scoped to dispatched runners so
un-launched scripts are not counted as failed.  Force a non-zero result
on interrupt (Windows cannot re-raise), and write the envelope
atomically so a second Ctrl+C cannot truncate it.

Issue: #27859
2026-07-06 15:17:58 +02:00
Brad King 5b0aee4961 Drop Visual Studio 14 2015 generator
This generator has been deprecated since CMake 4.2.  Remove it.
2026-07-03 11:53:32 -04:00
Aiden Woodruff ca3d1007f0 Tests: Simplify RunCMake.CompilerChange
The test suite can be simplified now that command line arguments are
restored after resetting the cache due to a compiler change. Previously
the test case name had to be set in the environment and now that is not
required.
2026-07-03 10:20:20 -04:00
Tyler Yankee fd395b25b5 ctest: Improve colorization in output
Refactor CTest's logging to replace custom color code handling with the
infrastructure introduced in commit 329d755dbd (StdIo: Add a Terminal
abstraction to print color text, 2025-05-06).

Avoid ANSI escape sequences in files passed to `--output-log-file`.

Fixes: #27915
2026-07-03 10:02:43 -04:00
Aiden Woodruff ee6bfdc1f3 CMAKE_TOOLCHAIN_FILE: Improve recovery from changed compiler or toolchain file
Replace __CMAKE_DELETE_CACHE_CHANGE_VARS_ with a set of changed
variables in cmState to avoid interference from scripts and simplify
handling of changed variables.

Errors during configure step will block re-configure when the toolchain
file has changed. Downstream errors can be caused by failing in
EnableLanguage without an error, behavior introduced in 7a989ed58a
(CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache, 2026-06-24).
Errors directly related to a changed toolchain file should be fixed by
using the new one.

Trigger a fatal error when the toolchain file change is detected to
avoid wasteful configure that will be reset anyway, then re-configure
only for that specific case. Avoid re-configuring multiple times.

Fixes: #27867
2026-07-03 09:25:33 -04:00
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