Commit Graph

38235 Commits

Author SHA1 Message Date
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
Brad King
ec0cf06316 Merge topic 'instrumentation-always-record-build'
e730008d7e instrumentation: Record build snippets regardless of hooks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11255
2025-09-30 10:05:02 -04:00
Tyler Yankee
f029bd04bf instrumentation: Write trace file incrementally
Periodically clearing the output stream buffer saves on memory usage
for large traces.
2025-09-30 10:00:39 -04:00
Tyler Yankee
0882a37f73 instrumentation: Load snippets individually for trace
Only loading the necessary timing data and deferring the dump of all
snippet data into the trace file saves on memory for large traces.
2025-09-30 10:00:37 -04:00
Brad King
7d551a5d6b Merge topic 'genex-transitive-link-libraries'
e0bbe79cea CMP0189: Restore support for linking `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
cb69f750bf cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11262
2025-09-30 09:59:09 -04:00
Brad King
c6934e0928 Merge topic 'vs-sdk-style-platform-override'
4ebedf246d VS: Fix SLNs for DOTNET_SDK targets with VS_GLOBAL_PlatformTarget

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Steven Boswell <ulatekh@yahoo.com>
Merge-request: !11247
2025-09-30 09:57:09 -04:00
Brad King
d6e6facc51 Merge topic 'vs-sln'
4747b64fff VS: Restore include_external_msproject type detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11266
2025-09-30 09:45:02 -04:00
Kitware Robot
424f0570f1 CMake Nightly Date Stamp 2025-09-30 00:04:56 -04:00
Craig Scott
2f653056af presets: Detect abnormal termination of workflow step commands
If the command for a step (cmake, ctest, or cpack) terminates abnormally,
libuv sets the exit code to 0 and reports the process termination signal
in a separate struct member. That carries through to the structure we use
to track the process and ultimately give back to the workflow step loop.
Don't rely on the exit code alone to test for failure, also check for spawning
errors and abnormal termination too.

Fixes: #27273
2025-09-30 13:04:48 +10:00
AJIOB
83bbde5449 MSVC: Define _WINDLL consistently for shared libraries
Visual Studio defines this automatically for `.dll` targets.
For consistency, define it when compiling for the MSVC ABI
with other generators.  Add policy CMP0203 for compatibility.

Fixes: #27253
2025-09-29 18:26:44 -04:00
Eduard Voronkin
05360d19e9 FASTBuild: fix use-after-move
Since order of parameters' evaluation
is unspecified in C++, it might happen that
we move `val` before we call `substt()`.
2025-09-29 14:48:46 -07:00
Brad King
4747b64fff VS: Restore include_external_msproject type detection
Refactoring in commit 3882718872 (VS: Decouple solution generation from
`.sln` file format, 2025-09-15) accidentally left out automatic
detection of the external project type id from its file extension.
2025-09-29 16:47:46 -04:00
Eduard Voronkin
c4369b81aa FASTBuild: fix paths' comparison on Windows
On Windows we might have different slashes,
so ` if (binDir == converted)` will not work
even for semantically equivalent directories.
2025-09-29 13:13:57 -07:00
Jelle
4ebedf246d VS: Fix SLNs for DOTNET_SDK targets with VS_GLOBAL_PlatformTarget
By default, .NET SDK-style projects build for "Any CPU", so we generate
solution files accordingly.  Although CMake does not model per-target
architectures, some projects set the `VS_GLOBAL_PlatformTarget` property
on `DOTNET_SDK` targets in order to compile for a specific architecture.
Fix generated solution files to account for the architecture override.

Issue: #23513
2025-09-29 12:25:01 -04:00
Brad King
e0bbe79cea CMP0189: Restore support for linking $<TARGET_PROPERTY:tgt,LINK_LIBRARIES>
In general we disallow references to transitive target properties, such
as `COMPILE_DEFINITIONS`, in `[INTERFACE_]LINK_LIBRARIES` properties,
because the latter establish the transitivity itself.  Prior to CMP0189,
the `[INTERFACE_]LINK_LIBRARIES` properties were not themselves transitive
in `$<TARGET_PROPERTY>` expressions, so existing projects have code like

    target_link_libraries(foo PRIVATE "$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>")

Policy CMP0189's NEW behavior, introduced by commit b3da9c6d60 (GenEx:
Evaluate LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), makes `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
transitive, causing the above to be rejected.  Since evaluation of a
target's link libraries can already encounter and handle other targets'
link libraries, allow it in this case.

Fixes: #27265
2025-09-29 10:51:01 -04:00
Martin Duffy
f6714b8949 instrumentation: Trigger PostGenerate hook after FileApi replies are written
Fixes: #27268
2025-09-29 09:43:53 -04:00
Brad King
cca334aa26 Merge topic 'update-libarchive'
ff95dc7f44 libarchive: Set build options the way we need for CMake
3f00851b3e libarchive: Add missing cm3p prefixes on includes
4e5c2aadb1 libarchive: Rename cm_get_date wrapper to cm_parse_date
cf04a5cf27 Merge branch 'upstream-LibArchive' into update-libarchive
bb6def24fe LibArchive 2025-06-01 (9525f90c)
b2c42d8207 libarchive: Update script to get 3.8.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11258
2025-09-29 09:27:58 -04:00
Brad King
5291c17310 Merge topic 'instrumentation-load-null'
11f67d416a instrumentation: Use null when CPU load is unknown

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11248
2025-09-29 09:23:03 -04:00
Brad King
e49de5d5d6 Merge topic 'fileapi-interface-and-imported-targets'
b626843d71 fileAPI: Output all INTERFACE and IMPORTED targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11232
2025-09-29 09:21:45 -04:00