Commit Graph
39554 Commits
Author SHA1 Message Date
Brad King f4c33c7762 Merge topic 'better-policy-diagnostics'
763cfbcac8 Diagnostics: "Fix" policy warnings in modules
a7415d243a Diagnostics: Simplify issuing policy warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12079
2026-05-21 09:47:07 -04:00
Kitware Robot d36a8846c9 CMake Nightly Date Stamp 2026-05-21 00:05:03 -04:00
Matthew Woehlke 763cfbcac8 Diagnostics: "Fix" policy warnings in modules
Introduce a mechanism (via the private and undocumented `ISSUE_WARNING`
option to the `cmake_policy` command) to allow built-in modules to issue
policy warnings. Update modules to use this.

This allows modules to issue policy warnings with the `CMD_POLICY`
diagnostic type, which is consistent with internally issued diagnostics.
This also tends to simplify the logic for issuing such warnings in much
the way the helpers introduced in the previous commit did for the C++
code.
2026-05-20 15:32:57 -04:00
Brad King d2e20c74ed Merge topic 'ctest-help-args'
c0eddfb8c8 ctest: Add missing help strings for documented options
2f3de9e2f3 Help/ctest: Improve formatting and grammar
36e486555d Help, ctest: Add argument placeholders
e16767d962 presets: Fix command help for --presets-file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12088
2026-05-20 15:01:30 -04:00
Brad King aa08e3b2e0 Merge topic 'xcode-link-phase-no-framework-names'
b34e15a07d Xcode: Don't add frameworks without absolute paths to Frameworks PBXGroup
41f8011d61 Xcode: Don't add bare-name framework items to the link build phase

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12022
2026-05-20 15:00:01 -04:00
Brad King 7f8ffcd77c Merge topic 'cps-fix-default-dest'
9d94a2abe6 Merge branch 'backport-cps-fix-default-dest' into cps-fix-default-dest
ed6e9abf98 CPS, SBOM: Fix default output destination

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12082
2026-05-20 14:57:56 -04:00
Brad King 3cb3d1cd45 Merge topic 'help-lang-specific-vars'
bd059a9c54 Help: Allow command-line help of per-language and per-config variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12081
2026-05-20 14:54:20 -04:00
Brad King 081bba50ec Merge topic 'continue-in-macro'
a0f0e52dbd macro: Fix handling of 'continue' inside macros

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12085
2026-05-20 14:51:54 -04:00
Brad King e61cd9a7dd Merge topic 'presets-script-mode'
e93ac092a7 cmake: Disallow --preset with -P script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12075
2026-05-20 14:48:46 -04:00
Brad King 04003104d0 Merge topic 'hexfile-overflow'
2e55f86bb3 cmHexFileConverter: Avoid stack buffer overflow

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12074
2026-05-20 14:45:45 -04:00
Matthew Woehlke a7415d243a Diagnostics: Simplify issuing policy warnings
Add and use a couple helper functions for issuing policy warnings. This
improves consistency and allows some simplification of many call sites.
(One or two instances in particular are greatly simplified.)
2026-05-20 11:55:13 -04:00
Kitware Robot 84e25b5859 CMake Nightly Date Stamp 2026-05-20 00:05:09 -04:00
Brad King 9d94a2abe6 Merge branch 'backport-cps-fix-default-dest' into cps-fix-default-dest 2026-05-19 15:26:46 -04:00
Martin Duffy bd059a9c54 Help: Allow command-line help of per-language and per-config variables
Extend commit 4e50320978 (Help: Allow help for arbitrary keywords,
2023-08-31, v3.28.0-rc1~31^2).
2026-05-19 15:10:11 -04:00
Tor Arne Vestbø b34e15a07d Xcode: Don't add frameworks without absolute paths to Frameworks PBXGroup
We can't represent frameworks as PBXFileReferences unless we have
an existing absolute path, or are able to resolve relative paths
(including framework name only) to an SDK-root relative or absolute
path, which we don't do at the moment.

Which means we can't represent these frameworks in the Frameworks
group in the project, as they will have wrong paths and be shown
by Xcode as missing.
2026-05-19 14:48:59 -04:00
Ruslan Baratov a0f0e52dbd macro: Fix handling of 'continue' inside macros
Fixes: #17677
2026-05-19 14:45:40 -04:00
Matthew Woehlke ed6e9abf98 CPS, SBOM: Fix default output destination
- Change default CPS install path on Windows from `cps` to `cps/<name>`,
per community recommendation that only paths containing the package name
should be considered as "officially" supported search locations (see
https://github.com/cps-org/cps/issues/79#issuecomment-2831102822).

- Change `export` to write to a subdirectory that allows the build
tree to be used as a search root.

- Change SBOM destinations to be consistent with the preceding.

Issue: #27785
2026-05-19 13:31:56 -04:00
Tyler Yankee c0eddfb8c8 ctest: Add missing help strings for documented options 2026-05-19 11:49:29 -04:00
Tyler Yankee 36e486555d Help, ctest: Add argument placeholders
Conventionally, CMake help modes and manuals/documentation specify
placeholders for options which take one or many values after the option
name. Several existing `ctest` options do not follow this.

Fixes: #27827
2026-05-19 11:49:28 -04:00
Tyler Yankee e16767d962 presets: Fix command help for --presets-file
Amends commit 95edd93948 (presets: Support loading from arbitrary file,
2026-03-18).
2026-05-19 11:49:26 -04:00
Brad King 485b155cb9 Merge topic 'swift-pdb'
404f6bac3c Swift: support PDB emission with Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12064
2026-05-19 09:04:41 -04:00
Kitware Robot 4f5d22f085 CMake Nightly Date Stamp 2026-05-19 00:05:39 -04:00
Kitware Robot 24d023247a CMake Nightly Date Stamp 2026-05-18 00:09:04 -04:00
Tyler Yankee e93ac092a7 cmake: Disallow --preset with -P script mode
Fixes: #25495
2026-05-17 14:47:42 -04:00
Kitware Robot d2f11ff7b5 CMake Nightly Date Stamp 2026-05-17 00:05:09 -04:00
Tyler Yankee 2e55f86bb3 cmHexFileConverter: Avoid stack buffer overflow
Prevent overflow on maliciously-crafted Motorola S1 record files which
have a maximum line length over the 256-byte maximum.
2026-05-16 16:13:30 -04:00
Brad King afad360df9 Merge topic 'cmake-more-diagnostics'
028d3183ad Diagnostics: Add POLICY, EXPERIMENTAL
92e0ca9046 Diagnostics: Show author message for all descendants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12034
2026-05-16 09:53:27 -04:00
Brad King e0d36bf70b Merge topic 'cpack-sort-archive-files'
cbb903efd9 CPack: Archive files in a reproducible order

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12069
2026-05-16 09:47:52 -04:00
Saleem Abdulrasool 404f6bac3c Swift: support PDB emission with Swift
Swift supports CodeView/PDB for Windows (with active development ongoing
to make it the default). It is currently usable but does not have the
same fidelity as DWARF, but can be sufficient for many use cases. The
user is able to control this via flags. Wire up the necessary support to
allow `TARGET_PDB_FILE` to be used with Swift/Swift-only targets.
2026-05-16 09:05:46 -04:00
Kitware Robot c83193953c CMake Nightly Date Stamp 2026-05-16 00:09:37 -04:00
Steve Peters cbb903efd9 CPack: Archive files in a reproducible order
Issue: #23466
2026-05-15 13:55:25 -04:00
Brad King c5def30873 Merge topic 'cache-newlines-in-warning-message'
50ce808ca7 Tests: Move cache variable help string test
053f02a41c cmCacheManager: Fix warning comment for cache vars containing newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12057
2026-05-15 10:19:35 -04:00
Brad King 08e5ffbeac Merge topic 'fileset-SKIP_UNITY_BUILD_INCLUSION'
5f7a7aa263 FILE_SET: add SKIP_UNITY_BUILD_INCLUSION property support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12040
2026-05-15 10:18:03 -04:00
Brad King e0b79bddd0 Merge topic 'ctest-llvm-cov'
e0ac166e7b ctest: Parse Clang Source code coverage files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12049
2026-05-15 10:16:00 -04:00
Matthew Woehlke 028d3183ad Diagnostics: Add POLICY, EXPERIMENTAL
Add new diagnostic categories CMD_POLICY and CMD_EXPERIMENTAL, both as
children of CMD_AUTHOR. Use the former when issuing policy warnings. Use
the latter when issuing experimental feature warnings.
2026-05-15 09:57:23 -04:00
Matthew Woehlke 92e0ca9046 Diagnostics: Show author message for all descendants
Tweak `cmMessenger` to also show the "warning is for project developers"
notice for all diagnostics that are descendants of the `CMD_AUTHOR`
category. When doing so, also show both command-line options which can
suppress the message.
2026-05-15 09:57:23 -04:00
Kitware Robot 9341574b1b CMake Nightly Date Stamp 2026-05-15 00:05:33 -04:00
Marc Chevrier 5f7a7aa263 FILE_SET: add SKIP_UNITY_BUILD_INCLUSION property support 2026-05-14 10:55:35 -04:00
Brad King 84a843cfb6 Merge topic 'file-api-many-file-sets'
9f4cf1cef7 fileAPI: Report full backtraces for sources in multiple file sets
3d249d2aa9 fileAPI: Support files added to multiple file sets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12009
2026-05-14 10:40:22 -04:00
Brad King 08bf1b6985 Merge topic 'ctest_commands_presets_file'
08dc82ceb3 ctest: add PRESETS_FILE option to CTest commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12042
2026-05-14 08:53:25 -04:00
Brad King ffa4c4b527 Merge topic 'ctest-win32-progress-erase'
a111f56863 ctest: Simplify progress summary line logic
8736d42793 ctest: Fix progress summary line erasure on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12047
2026-05-14 08:49:33 -04:00
Brad King cac49ed760 Merge topic 'cmELF-max'
d67c1b04ec cmELF: Protect against OOM on malformed files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12036
2026-05-14 08:47:25 -04:00
Brad King 011fc8be63 Merge topic 'feature/list-functor-no-macro'
96c9a9c67d list: Reject macros as APPLY/PREDICATE/COMPARATOR arguments
08288eb14a list: Extract RequireFunction helper for command validation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11997
2026-05-14 08:45:19 -04:00
Joseph Snyder e0ac166e7b ctest: Parse Clang Source code coverage files
Introduce the capability to use the Clang Source code coverage capability
to generate coverage information for a submission to CDash.

This handler will:
  * Recursively glob the binary directory for coverage files (`*.profdata`)
  * Use the `llvm-profdata` tool to merge all found files into a single
    `default.profdata` file
  * Recursively glob the binary directory for .o files
  * Use the `llvm-cov export` capability to parse the coverage information
    found for each object file

Since the coverage information contains branch coverage, add new attributes
to the CoverageLog Line object to capture the number of branches that are
covered and uncovered

See documentation page here
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
2026-05-14 08:35:49 -04:00
Kitware Robot dd2671609d CMake Nightly Date Stamp 2026-05-14 00:05:36 -04:00
Tyler Yankee 053f02a41c cmCacheManager: Fix warning comment for cache vars containing newlines
Reuse the logic from commit 637a0f7ed4 (cmCacheManager: Prevent
corruption from multiline help strings, 2025-02-04, v4.0.0-rc1~52^2)
for the warning message placed in the cache when a cache variable's
value contains one or more newline characters.

While we're at it, remove a superfluous early-exit in the help strings
method.

Fixes: #27807

Suggested-By: Yauheni Khnykin <yauheni.khnykin@here.com>
2026-05-13 18:21:04 -04:00
Tyler Yankee d67c1b04ec cmELF: Protect against OOM on malformed files
Cap the number of ELF sections, the section size, and the number of
dynamic entries to reasonable limits for real-world binaries to prevent
OOM on malformed inputs.
2026-05-13 15:51:55 -04:00
Brad King a111f56863 ctest: Simplify progress summary line logic
Avoid relying on separate buffering of `cout` and `printf`.
2026-05-13 14:40:52 -04:00
Derek Huang 8736d42793 ctest: Fix progress summary line erasure on Windows
We only print progress output when VT100 escapes are supported,
even on Windows, so we can erase the line there too.

Fixes: #27814
Issue: #26924
2026-05-13 14:37:51 -04:00
Brad King 3d1f9d3dee Merge topic 'extra-gen-always-warn'
727e32ff48 Extra Generators: Always warn

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12050
2026-05-13 13:50:03 -04:00