Commit Graph

38253 Commits

Author SHA1 Message Date
Brad King
614d295c1e VS: Compute MSVC character set in CUDA-only targets
Fix commit 6874efb592 (MSVC: Always define a character set, 2025-09-24)
for CUDA in Visual Studio.
2025-10-10 17:07:36 -04:00
Brad King
19a61e56cf VS: Refactor MSVC character set selection 2025-10-10 16:55:02 -04:00
Brad King
10556731a1 Begin 4.2 release versioning 2025-10-09 10:22:10 -04:00
Brad King
32689113d7 Merge topic 'genex-target-intermediate-dir'
f195c9ef2a genex: Add TARGET_INTERMEDIATE_DIR expression
5c5634db52 cmGeneratorExpressionNode: Factor out HasKnownObjectFileLocation check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11217
2025-10-09 09:12:40 -04:00
Martin Duffy
f195c9ef2a genex: Add TARGET_INTERMEDIATE_DIR expression
Fixes: #27196
2025-10-09 08:07:20 -04:00
Brad King
420be50b5e Merge topic 'depfile-empty'
2c300a4c0a Fix out-of-bounds read on empty gcc-style depfile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11293
2025-10-09 08:03:25 -04:00
Kitware Robot
48b5d61970 CMake Nightly Date Stamp 2025-10-09 00:04:45 -04:00
Martin Duffy
5c5634db52 cmGeneratorExpressionNode: Factor out HasKnownObjectFileLocation check 2025-10-08 17:34:02 -04:00
Joerg Bornemann
2c300a4c0a Fix out-of-bounds read on empty gcc-style depfile
If a gcc dep file is read that contains no dependencies,
cmReadGccDepfile returns a valid std::optional containing an empty
vector. Check at the call sites in cmDependsCompiler whether the vector
is empty before trying to access the vector's elements.

Fixes: #27270
2025-10-08 11:37:15 -04:00
Brad King
81ee78a7e9 Merge topic 'update-kwsys'
77ea15b797 Tests: Add case covering `cmake -E env` with empty environment variable
209dfc51d3 Merge branch 'upstream-KWSys' into update-kwsys
92a7104600 KWSys 2025-10-08 (3bae03fe)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11288
2025-10-08 11:25:25 -04:00
Brad King
04c6c8fc09 Merge topic 'set-ENV-empty'
aa5711490f set: Explicitly unset empty environment variables on Windows
723a83d8cd set: Factor out helper to set environment variables
20761cf349 set: Add test cases for setting ENV{VAR} to empty
a878d1c490 Tests: Unset the PATH environment variable more explicitly where needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11290
2025-10-08 11:20:36 -04:00
Brad King
209dfc51d3 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-10-08 (3bae03fe)
2025-10-08 11:17:13 -04:00
Brad King
6fdb345f03 Merge topic 'sort-xcode-folders'
4ca5e5480a Xcode: Order targets alphabetically

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11289
2025-10-08 09:32:56 -04:00
Kitware Robot
10ad3364d6 CMake Nightly Date Stamp 2025-10-08 00:05:03 -04:00
Brad King
aa5711490f set: Explicitly unset empty environment variables on Windows
KWSys's SystemTools::PutEnv implementation, on Windows, has long
interpreted `A=` as unset.  This differs from the behavior on other
platforms.  Code the distinction explicitly in `set(ENV{VAR})`.

Issue: #27285
2025-10-07 11:33:03 -04:00
Brad King
723a83d8cd set: Factor out helper to set environment variables 2025-10-07 11:32:56 -04:00
Peter Steneteg
4ca5e5480a Xcode: Order targets alphabetically
Fixes: #21659
2025-10-07 11:07:11 -04:00
Craig Scott
f38f325e08 fileAPI: Add direct dependencies to target codemodel files
This adds the following new arrays, which together capture all direct
dependencies and interface dependencies of a target:

- linkLibraries
- interfaceLinkLibraries
- compileDependencies
- interfaceCompileDependencies
- objectDependencies
- orderDependencies

Fixes: #21995, #25213
2025-10-07 10:44:28 -04:00
Craig Scott
1b764b6816 cmLinkItem: Remove redundant cmLinkImplItem class
The cmLinkImplItem class used to contain some additional members
to support the CMP0027 policy. Since the CMP0027 policy and those
associated members were removed, the cmLinkImplItem class has been
a plain wrapper around cmLinkItem with no additional members.
It is no longer needed and cmLinkItem can be used directly wherever
cmLinkImplItem was used previously.
2025-10-07 10:44:28 -04:00
Brad King
0181fb4cc5 Merge topic 'define-msvc-charset'
b554dead95 Tests: Cover CMP0203 and CMP0204 on all platforms
6874efb592 MSVC: Always define a character set
2cae68ecbe Source: Minor optimizations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11269
2025-10-07 10:43:08 -04:00
AJIOB
6874efb592 MSVC: Always define a character set
When targeting the MSVC ABI, define `_MBCS` by default if the project
does not define `_SBCS` or `_UNICODE`.  Visual Studio has long defined
one of the three character set macros automatically.  For consistency,
define it when compiling for the MSVC ABI with other generators.
Add policy CMP0204 for compatibility.

Fixes: #27275
2025-10-07 09:29:32 -04:00
AJIOB
2cae68ecbe Source: Minor optimizations 2025-10-07 09:29:18 -04:00
Brad King
0af6751e68 Merge topic 'ninja-trailing-newline-comment'
12a225d56d Ninja: handle trailing newlines in variable stanzas

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11286
2025-10-07 08:58:52 -04:00
Kitware Robot
53716f6bfd CMake Nightly Date Stamp 2025-10-07 00:04:46 -04:00
Ben Boeckel
12a225d56d Ninja: handle trailing newlines in variable stanzas
When a variable ends with a newline, the Ninja generator escapes it as
expected with `$\n`. However, when writing it out, whitespace is
trimmed. This leaves a trailing `$` instead which consumes the newline
and masks the following stanza. In a custom command, this hides the
`restat = 1` setting.

Detect this case and restore the newline as necessary.

See: #25983
2025-10-06 09:54:15 -04:00
Kitware Robot
f2afbff2c4 CMake Nightly Date Stamp 2025-10-06 00:04:37 -04:00
Kitware Robot
d212c84bf9 CMake Nightly Date Stamp 2025-10-05 00:04:42 -04:00
Kitware Robot
73fa6ab3e6 CMake Nightly Date Stamp 2025-10-04 00:04:52 -04:00
Brad King
0d01bc72b8 Merge topic 'cps-symbolic-info'
62a1d3e7f1 FileAPI: Add symbolic property to targets
d92b6c3e20 CPS: Add Symbolic Components
03284e018f Help: Simplify file-api version information for "abstract" field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11132
2025-10-03 11:24:50 -04:00
Brad King
caf01b88bc Merge topic 'instrumentation-target-content'
97adbc91fa instrumentation: Move target data into content files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11251
2025-10-03 11:21:17 -04:00
Brad King
e9beb26909 Merge topic 'pkg-root-var'
1a16e4fc69 Merge branch 'backport-pkg-root-var' into pkg-root-var
87a661a916 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
fc059e1978 Merge branch 'backport-pkg-root-var' into pkg-root-var
ab0a44a0a0 find_package: Fix regression on `<PackageName>_ROOT` relative to CWD
d029b828b2 find_package: Avoid repeating search for lower-case .cps file
fc4d238d7a Tests: Match RunCMake.find_package-CPS version candidates more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11277
2025-10-03 11:12:07 -04:00
Kitware Robot
279729b85a CMake Nightly Date Stamp 2025-10-03 00:04:57 -04:00
Robert Maynard
87a661a916 find_package: Fix regression on <PackageName>_ROOT relative to CWD
In commit 9d44a77454 (find_*: Explicitly normalize found paths as they
exist on disk, 2024-10-17, v4.0.0-rc1~597^2~1), we removed path
normalization from the internal `cmSearchPath::AddPathInternal` helper.
Most call sites were updated to normalize input paths first, but search
paths derived from `<PackageName>_ROOT` CMake variables are no longer
normalized.  Instead we normalize the path to the file found after
searching.

When `find_package` "config" mode considers a candidate CMake package
configuration file, normalize its path before loading the adjacent
package version file so that the latter is loaded by absolute path.
Otherwise `cmMakefile::ReadDependentFile` interprets a relative path
with respect to the current source directory rather than the current
working directory.

Fixes: #27279
2025-10-02 15:30:13 -04:00
Brad King
fc059e1978 Merge branch 'backport-pkg-root-var' into pkg-root-var 2025-10-02 15:28:03 -04:00
Brad King
d029b828b2 find_package: Avoid repeating search for lower-case .cps file 2025-10-02 15:24:47 -04:00
Brad King
0599d7e606 Merge topic 'doc-polish'
6babe38916 Help: Fix cmake_language(TRACE) command anchor
7aa81ae324 Help: Simplify release notes for find module version variables
09aded59f7 Help: Revise CMP0201 documentation using typical wording conventions
f98b4eecf6 Help: Document generators supporting CMAKE_INTERMEDIATE_DIR_STRATEGY
fe9fd66a8e Help: Improve CPack/WiX documentation markup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11276
2025-10-02 13:52:22 -04:00
Taylor Sasser
62a1d3e7f1 FileAPI: Add symbolic property to targets 2025-10-02 10:46:16 -04:00
Taylor Sasser
d92b6c3e20 CPS: Add Symbolic Components
Adds support for "symbolic" components, which represent feature-level
capabilities of a package that do not correspond to actual build targets.
These are modeled as pseudo-targets, using the INTERFACE type as a base,
and can be queried via:

  get_target_property(... <tgt> "SYMBOLIC")

This enables consumers to declare requirements on optional features
(e.g., SSL support) even when they do not map to concrete targets.

Fixes: #27187
2025-10-02 10:46:02 -04:00
Martin Duffy
97adbc91fa instrumentation: Move target data into content files
Create a single place to store target data to prevent duplication.
This moves `targetType` and `targetLabels` out of the snippet files
and into a target map in the `cmakeContent` file referenced by each
snippet.

Fixes: #27244
2025-10-02 09:28:20 -04:00
Kitware Robot
6ebaac438a CMake Nightly Date Stamp 2025-10-02 00:05:13 -04:00
Brad King
09aded59f7 Help: Revise CMP0201 documentation using typical wording conventions 2025-10-01 09:23:32 -04:00
Brad King
bef873755b Merge topic 'define-windll'
83bbde5449 MSVC: Define _WINDLL consistently for shared libraries
206fcbb392 Tests/RunCMake/FileAPI: Fix whitespace in codemodel-v2 expectation data

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11194
2025-10-01 09:18:05 -04:00
Brad King
35d3fb0e49 Merge topic 'instrumentation-trace-efficient'
f029bd04bf instrumentation: Write trace file incrementally
0882a37f73 instrumentation: Load snippets individually for trace
a31e781fe8 instrumentation: Use end time for snippet file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11249
2025-10-01 08:40:43 -04:00
Brad King
a5d0c8e415 Merge topic 'workflow-crashing-step-detection'
2f653056af presets: Detect abnormal termination of workflow step commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11268
2025-10-01 08:38:11 -04:00
Kitware Robot
feb73760df CMake Nightly Date Stamp 2025-10-01 00:04:37 -04:00
Brad King
11f3f34077 CMake 4.1.2 2025-09-30 10:48:33 -04:00
Brad King
021fb8d4e1 Merge topic 'fbuild_fix_use_after_move'
05360d19e9 FASTBuild: fix use-after-move

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11267
2025-09-30 10:18:05 -04:00
Brad King
d49518e367 Merge topic 'fbuild_relative_path_on_windows'
c4369b81aa FASTBuild: fix paths' comparison on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11265
2025-09-30 10:17:09 -04:00
Brad King
88c317678e Merge topic 'xcode-icons'
e97fdf7d9a Xcode: Support new Icon Composer .icon resources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11259
2025-09-30 10:15:57 -04:00
Brad King
65e043ce93 Merge topic 'instrumentation-after-file-api'
f6714b8949 instrumentation: Trigger PostGenerate hook after FileApi replies are written

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11261
2025-09-30 10:07:10 -04:00