Commit Graph
39486 Commits
Author SHA1 Message Date
Brad King 0bbc2c0e9a Merge topic 'cmp0171-diagnostic-context'
556bd0d722 CMP0171: Improve diagnostic context

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12043
2026-05-12 10:42:38 -04:00
Brad King 89856f49dd Merge topic 'install-diagnostic-context'
5ed6b90a31 Diagnostics: Capture install state
42c7a97446 Diagnostics: Add class to record state
0556d1cfe9 Diagnostics: Ensure state is initialized

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12020
2026-05-12 10:37:58 -04:00
Brad King 64fc2f8089 Merge topic 'ctest-llvm-cov'
a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
5494697ed1 Tests: Add case for llvm-cov usage by ctest command line modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12007
2026-05-12 10:32:10 -04:00
Kitware Robot 61510710b1 CMake Nightly Date Stamp 2026-05-12 00:06:00 -04:00
Matthew Woehlke 556bd0d722 CMP0171: Improve diagnostic context
When issuing the policy warning that `codegen` is a reserved target
name, use the diagnostic context in which the target was declared,
rather than the root context (which cannot be affected in script).
2026-05-11 15:02:49 -04:00
Joseph Snyder a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
If the CTEST_TEST_COVERAGE_TOOL is set to LLVM-COV, use the
`llvm-profdata --merge` functionality to collect the `.profraw` files
generated by running each test into a combined `.profdata` file.
This is the file that could be used to parse or display coverage
information for each test.

Issue: #26932
2026-05-11 11:33:41 -04:00
Brad King 8f969efc07 Merge topic 'fix_compile_only_genex_dependencies'
3f811dc56f Add target ordering dependencies guarded by $<COMPILE_ONLY> genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12015
2026-05-11 11:19:06 -04:00
Brad King 3b24c78ed9 Merge topic 'ctest_test_preset_option'
ef0d2ca6bb ctest: add PRESET option for ctest_test() and ctest_memcheck()
f9c831dad9 ctest: encapsulate loading of options from test preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12017
2026-05-11 11:12:42 -04:00
Kitware Robot 86e03261e9 CMake Nightly Date Stamp 2026-05-11 00:05:34 -04:00
Kitware Robot 6a742d9af3 CMake Nightly Date Stamp 2026-05-10 00:05:12 -04:00
Kitware Robot 7e1b633a89 CMake Nightly Date Stamp 2026-05-09 00:05:22 -04:00
Matthew Woehlke 5ed6b90a31 Diagnostics: Capture install state
Modify `cmInstallGenerator` to have a `cmDiagnosticContext` instead of
just a `cmListFileBacktrace`. Create helpers to obtain a state capture
that includes `CMD_INSTALL_ABSOLUTE_DESTINATION`. Modify most subclasses
(namely, ones that have a `DESTINATION`) to use this new state capture.

This fixes a limitation identified when 39a56136a3 (Diagnostic: Add warn
or error on absolute install paths, 2026-03-25) added the aforementioned
diagnostic, that the install generator(s) no longer have access to the
diagnostic state as of the `install` invocation which ultimately caused
the diagnostic if that scope is not the top-most scope of the current
subdirectory.

Note that some of the generators which capture context have not actually
implemented the diagnostic yet.
2026-05-08 11:23:11 -04:00
Brad King 61680b3b44 Merge topic 'cmake-diagnostics-variables'
72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
be057c5a01 cmVariableWatch: Use enum for access type
cba542f32c cmake.cxx: Organize includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11948
2026-05-08 07:44:05 -04:00
Brad King f45ff406cd Merge topic 'gcc-implicit-libs'
168785c67e GCC: Fix linking mixed C and C++ binaries with GCC 16+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12027
2026-05-08 07:36:10 -04:00
Kitware Robot 13de864f90 CMake Nightly Date Stamp 2026-05-08 00:05:16 -04:00
Zack Galbreath ef0d2ca6bb ctest: add PRESET option for ctest_test() and ctest_memcheck()
Allow users to specify a test preset when using CTest dashboard scripts.

Fixes #27630
2026-05-07 22:08:41 -04:00
Zack Galbreath f9c831dad9 ctest: encapsulate loading of options from test preset
Encapsulate the assignment of cmCTestTestOptions from a test preset.
2026-05-07 21:16:23 -04:00
Matthew Woehlke 42c7a97446 Diagnostics: Add class to record state
Create new cmDiagnosticContext used to capture the diagnostic state for
instances when the issuing of a diagnostic might happen at a point far
separated from processing the CMake command ultimately responsible for
the diagnostic. (This is particularly the case for diagnostics that get
emitted during the generation phase.) In such cases, it is preferred
that we record the diagnostic state that pertained when the ultimately
instigating command was processed, so that users can control the
diagnostic in a natural manner.  Copying the entire cmStateSnapshot is
unreasonably expensive; this will provide a lighter-weight mechanism for
capturing the relevant diagnostic state for later use.

Since it is almost universal that the points where we would capture this
state also capture a stack trace (which is likewise used to issue
diagnostics), the new class contains a stack trace, and replaces the
stack trace in some diagnostic calls. (In some instances, an overload
which implicitly converts a stack trace to the new context class is
retained for convenience. These will behave the same, since capturing
diagnostic state is an optional function of the new class.)
2026-05-07 17:10:46 -04:00
Matthew Woehlke 0556d1cfe9 Diagnostics: Ensure state is initialized
Tweak how we define the storage type for diagnostic state to ensure that
the memory is always initialized.
2026-05-07 17:09:29 -04:00
Matthew Woehlke 72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
Update documentation for aforementioned variables, as their use is
deprecated under the new diagnostic system. Introduce a policy which
reintroduces their use to control specific deprecation diagnostics if
the policy is not NEW.

Note that this means there is NO synchronization between the variables
and the new diagnostic state.
2026-05-07 11:07:27 -04:00
Matthew Woehlke be057c5a01 cmVariableWatch: Use enum for access type
Adjust variable watches to pass the access type as the `enum` rather
than as an `int`.
2026-05-07 11:07:27 -04:00
Brad King 168785c67e GCC: Fix linking mixed C and C++ binaries with GCC 16+
As of GCC 16, `gcc` implies `gcc_s_asneeded` but `g++` implies `gcc_s`.
When linking mixed C and C++ binaries, avoid listing one if the other is
already implied by the linker language.

Fixes: #27796
2026-05-07 10:41:57 -04:00
Brad King 46410ea189 Merge topic 'list-sort-comparator'
3dc32ac62b list(SORT): Add COMPARATOR option for user-defined comparisons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11946
2026-05-07 08:08:42 -04:00
Brad King ea1d99dc18 Merge topic 'nagfor_response_files'
65fbe16e16 NAG Fortran: Use `-xldarg @` to pass response files to the linker
6dc46638f4 NAG Fortran: Fix response file flag for creating archives
b53d3c7cc1 Makefiles: Make logic enabling CUDA device link response files more specific

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12013
2026-05-07 08:01:36 -04:00
Brad King fc9f280bab Merge topic 'install-style'
732b9585a7 Style: Use camelCase identifiers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12016
2026-05-07 07:57:26 -04:00
Kitware Robot c54c021b21 CMake Nightly Date Stamp 2026-05-07 00:05:43 -04:00
Robert Maynard 3f811dc56f Add target ordering dependencies guarded by $<COMPILE_ONLY> genex
`LINK_LIBRARIES` entries guarded by `$<COMPILE_ONLY:...>` are not
linked, but must participate in target ordering so files generated by
compile-only dependencies, like headers, are available before
compilation.

Fixes: #27792
2026-05-06 16:39:31 -04:00
Mickaël Germain 3dc32ac62b list(SORT): Add COMPARATOR option for user-defined comparisons
Allow users to provide a custom comparison function for `list(SORT)`.
The comparator is validated for strict weak ordering at runtime to
produce a clear CMake error rather than a platform-dependent abort.

Closes: #27761
2026-05-06 15:09:06 -04:00
Matthew Woehlke 732b9585a7 Style: Use camelCase identifiers
Fix most snake_case identifiers in cmInstall* to use camelCase instead.

Also, update clang-tidy configuration to help with applying these
changes, though the relevant check remains off by default.
2026-05-06 11:17:02 -04:00
Brad King 6b12950c9d Merge topic 'file-api-FILE_SET-SOURCES'
56b3136f60 fileapi: Add build properties for SOURCES file set type to codemodel

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12006
2026-05-06 09:41:11 -04:00
Kitware Robot 482a618375 CMake Nightly Date Stamp 2026-05-06 00:06:57 -04:00
Simon Maertens 6dc46638f4 NAG Fortran: Fix response file flag for creating archives
Since commit 10d6c3a635 (NAG: Pass response files through front-end to
the linker, 2018-08-01, v3.13.0-rc1~244^2) we use `-Wl,@` instead of `@`
in order to pass the response file through the `nagfor` compiler driver
to the linker.  However, this is not needed for the archiver.  Create
a separate rule variable so we can use different response file flags
for archiving and linking.

Issue: #23577
2026-05-05 20:07:17 -04:00
56b3136f60 fileapi: Add build properties for SOURCES file set type to codemodel
This complements commit 5c5b68f44e (FILE_SET: Add support for the
SOURCES type, 2026-03-12).

Co-Authored-By: Brad King <brad.king@kitware.com>
Co-Authored-By: Tyler Yankee <tyler.yankee@kitware.com>
2026-05-05 19:57:54 -04:00
Simon Maertens b53d3c7cc1 Makefiles: Make logic enabling CUDA device link response files more specific
Prepare to add more non-Link types of response files.
2026-05-05 15:53:27 -04:00
Brad King ffe0edc092 Merge topic 'list-predicate'
15340d6a96 list(FILTER): Add PREDICATE mode
c7af6e94d8 list(TRANSFORM): Add PREDICATE selector
0f30e0fe1c Help: Fix indentation of list(FILTER) docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11945
2026-05-05 10:58:32 -04:00
Brad King bf3a43e4ad Merge topic 'JOB_POOL_COMPILE-FileSet-property'
8e6eec8125 FILE_SET: add JOB_POOL_COMPILE property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12005
2026-05-05 10:55:51 -04:00
Brad King 885b588502 Merge topic 'SKIP_LINTING-FileSet-property'
f18ba89862 FILE_SET: add SKIP_LINTING property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12004
2026-05-05 10:54:37 -04:00
Brad King 0469dc90c4 Merge topic 'cmake-diagnostics-check-order'
91e81bf262 Diagnostics: Ensure correct ordering
700f64cfb9 cmDiagnostics: Fix typo in source documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12002
2026-05-05 10:51:52 -04:00
Brad King 0daa41a8fd Merge topic 'presets-error-diagnostics'
654a195d8b presets: Improve error diagnostics
c6e81bf30e Help/presets: Disallow empty env keys in build presets also

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !11987
2026-05-05 10:50:28 -04:00
Brad King b0c1507fbf Merge topic 'fbuild_unity_exclude'
05ac9db640 FASTBuild: use UnityInputExcludedFiles for unity skips

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12003
2026-05-05 10:46:59 -04:00
Brad King a05a143930 Merge topic 'ci-fedora-44'
f95c3c1ac0 ci: Update Clang HIP/CUDA wrappers for C++ 26 with libstdc++ 16 on Fedora 44
22a0b461dc ci: use Fedora 44 images and environments
33421d31e3 ci: update Fedora base images to Fedora 44
5182cd415d ci: Update to BullseyeCoverage 9.25.1
2c3a9fcabe clang-tidy module: Update to build against LLVM/Clang 22
e9b6b15082 clang-tidy: ignore warnings new in version 22
9207cccc00 clang-tidy: fix modernize-make-unique lint
859c541be8 pre-commit: update to `typos` 1.45.2
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12008
2026-05-05 10:41:23 -04:00
Kitware Robot d78407d434 CMake Nightly Date Stamp 2026-05-05 00:06:11 -04:00
Brad King 9207cccc00 clang-tidy: fix modernize-make-unique lint 2026-05-04 18:58:59 -04:00
Matthew Woehlke cba542f32c cmake.cxx: Organize includes
Consolidate includes that are predicated on not-BOOTSTRAP, and move some
other conditional includes to be in their own 'group' rather than
interleaved with the bulk of includes. This combines the main block of
includes into an actual, single block which formatting tools can ensure
is lexicographically sorted, rather than being recognized as several,
separate blocks which had led to sorting being somewhat inconsistent.
2026-05-04 11:28:00 -04:00
Brad King 8386ae08e1 LexerParser: Suppress gcc -Wunused-but-set-variable in generated code 2026-05-04 11:20:00 -04:00
Brad King 50e35d69c0 cmStringAlgorithms: Avoid -Wmaybe-uninitialized in cmAlphaNum constructor
The `string_view` constructor does not dereference its pointer before
we initialize the data, but the compiler doesn't know that.
2026-05-04 11:20:00 -04:00
Brad King 0c5bebf0ae cmSystemTools: Suppress clang-analyzer false positive
`clang-analyzer` cannot see that a moved-from value is re-assigned
via an output argument.
2026-05-04 11:20:00 -04:00
Eduard Voronkin 05ac9db640 FASTBuild: use UnityInputExcludedFiles for unity skips
Prefer it over `UnityInputIsolatedFiles` to enable caching for the
files.

Fixes: #27784
2026-05-04 11:00:38 -04:00
Brad King 1c4ef7291f Merge topic 'cmake-diagnostics-doc'
95f7f84609 Help: Fix CMD_INSTALL_ABSOLUTE_DESTINATION documentation
a882ec84ec cmDocumentation: Add diagnostics
97d13c3053 Help: Improve diagnostics documentation
3cccce8ca2 Help: Add developer documentation for new diagnostics
ffe4c2a8ff Help: Fix developer documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !11996
2026-05-04 10:32:28 -04:00
Brad King 871c7bcec2 Merge topic 'ctest-llvm-cov'
a7780d1b9c ctest: Add a `CoverageTool` setting to enable integration with `llvm-cov`
870d7d7cbe ctest: Introduce CTestDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11891
2026-05-04 10:21:12 -04:00