38440 Commits
Author SHA1 Message Date
Brad King 24581cbe98 CMake 4.2.7 2026-06-17 09:01:47 -04:00
Brad King 091d8a6bb8 Merge topic 'file-download-no-ssl-fix' into release-4.2
18d5daa7f3 file(DOWNLOAD/UPLOAD): Restore support for curl built without a TLS backend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12104
2026-05-27 14:59:15 -04:00
Daksh Mamodiya 18d5daa7f3 file(DOWNLOAD/UPLOAD): Restore support for curl built without a TLS backend
Since commit 38390245a2 (ctest: Require minimum TLS 1.2 by default,
2024-09-23, v3.31.0-rc1~47^2), our TLS-1.2 default fails with a curl
built without any TLS backend, causing even `file://` and `http://`
URLs to fail.  Teach CMake to recognize both ways libcurl may report
that it was built without TLS support.

Fixes: #27849
2026-05-27 13:59:01 -04:00
Brad King 046f192cf1 CMake 4.2.6 2026-05-21 13:31:34 -04:00
Brad King 6e79c3d631 Merge topic 'gcc-implicit-libs' into release-4.2
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:35:25 -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 414c24d13e CMake 4.2.5 2026-04-21 08:56:15 -04:00
Brad King 14d9bf456f CMake 4.1.6 2026-04-20 15:17:19 -04:00
Brad King 6acf715315 CMake 3.31.12 2026-04-20 13:40:12 -04:00
Brad King 253d70a68f Merge topic 'configure-log-buffering' into release-4.2
323cfece32 ConfigureLog: Eliminate unnecessary flush to improve write performance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11938
2026-04-16 09:11:41 -04:00
Peter Boettcher 323cfece32 ConfigureLog: Eliminate unnecessary flush to improve write performance
Replace `std::endl` with simple newline to eliminate performance issue
caused by a `write()` system call per line issued to the configure log.

The addition of the `find-v1` configure log item in commit e94ace226b
(Merge topic 'configure-log-find-v1', 2025-04-29, v4.1.0-rc1~266) caused
a large increase in the size of the configure log (1300 lines to 36000
lines in one test case) and exposed this latent performance issue.
It caused serious (10x) degradation in configure time when run on
common filesystems where `write()` is expensive, such as WSL or NFS.
2026-04-15 15:50:05 -04:00
Brad King 193b4ecda1 Merge topic 'backport-4.0-cmake-P-script-case' into release-4.1
a3358bb66a cmake: Restore normalization of `-P` script to on-disk path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11930
2026-04-14 09:22:19 -04:00
Brad King a2f1866d86 Merge branch 'backport-4.0-cmake-P-script-case' 2026-04-13 14:23:26 -04:00
Brad King a3358bb66a cmake: Restore normalization of -P script to on-disk path
This was missed in commit ee83165923 (cmake: Explicitly normalize
input paths as they exist on disk, 2024-10-17, v4.0.0-rc1~597^2),
causing `CMAKE_CURRENT_LIST_FILE` in `cmake -P` scripts to be
regressed by the KWSys behavior change merged by commit e9bd437a43
(Merge branch 'upstream-KWSys' into normalize-input-paths,
2024-10-24, v4.0.0-rc1~589^2~1).

Issue: #27750
2026-04-13 12:25:20 -04:00
Gusts Kaksis 8b92847daf Xcode: Fix target ordering operator to meet std::sort requirements
`std::sort` requires strict-weak ordering where `a == b` is false.

Backport commit 80d0770250 (Xcode: Fix target ordering operator to meet
std::sort requirements, 2024-10-10, v4.0.0-rc1~660^2~1) to CMake 3.31.
2026-04-02 13:18:12 -04:00
Brad King 561ece2407 cmFindPackageStack: Restore pure value semantics
A stack entry's storage may be shared by other copies, so mutation is
incompatible with value semantics.  We've migrated the motivating use
case to another approach.

Revert commit b3873b8272 (cmFindPackageStack: Allow controlled mutation,
2025-07-29, v4.2.0-rc1~438^2) and commit f2bdc2176f (cmStack: New,
mutable stack class, 2025-07-29, v4.2.0-rc1~438^2~1).  Record their
parent as a second parent of this commit so `git blame` can see the
original history of the restored content.
2026-04-01 13:47:24 -04:00
Brad King e935ed22fb find_package: Share package information among copies of package stack
Since commit ae373e93fb (install(PACKAGE_INFO): Add version and location
to package dependencies, 2025-07-31, v4.2.0-rc1~340^2) we add package
information to the current package's stack entry as it is discovered.
However, a nested package can cause the current package's stack entry to
be replaced by a copy with a new ordering index due to commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).  Depending on whether imported targets were
created by the current package before finding the nested package, the
`CurrentPackageInfo` pointer is either invalidated, or left pointing at
only one of multiple copies.

Fix this by sharing a single instance of package information with all
copies of the current package's stack entry.  Keep a mutable pointer
to the current package's information only while it is still pending.
This also avoids the need to expose mutation from the package stack.

Add a test that exposes the previously-invalidated pointer to dynamic
analysis tools.

Fixes: #27730
2026-04-01 13:47:01 -04:00
Brad King 5aa649d5f6 find_package: Save package information only after successfully loading it
If a package configuration file sets `<PackageName>_FOUND` to false,
the package is considered not found.  Do not save its package info.

Note that this exposes an existing pointer invalidation on nested
`find_package` calls, which will be fixed in following commits.

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King 2b22c2a45f find_package: Clarify dependency ordering logic in package stack
Clarify package stack manipulation from commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King cfbb1649dd CMake 4.2.4 2026-03-27 08:25:44 -04:00
Matthew Woehlke 7d2b4df69a CPS: Fix crash on bad paths in .cps file
The logic to compute the CPS prefix by comparing the specified relative
path to the actual path contained a potential overflow if the specified
path is longer than the actual path.  Fix this by comparing the path
lengths first.

Fixes: #27631
2026-02-23 14:54:02 -05:00
Brad King fe3fee4622 Merge topic 'ctest-launch-stdin' into release-4.2
0cc24534d7 ctest --launch: Restore sharing of stdin with child process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11709
2026-02-19 10:31:00 -05:00
Brad King 415881a36a Merge topic 'ctest-launch-stdin' into release-4.1
0cc24534d7 ctest --launch: Restore sharing of stdin with child process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11709
2026-02-19 10:30:46 -05:00
Brad King 10fb2d280d Merge topic 'ctest-launch-stdin' into release-4.0
0cc24534d7 ctest --launch: Restore sharing of stdin with child process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11709
2026-02-19 10:30:24 -05:00
Brad King 0cc24534d7 ctest --launch: Restore sharing of stdin with child process
This was broken by commit 96b3dd329e (cmCTestLaunchReporter: Replace
cmsysProcess with cmUVProcessChain, 2023-07-26, v3.28.0-rc1~138^2~2).
KWSys Process shares stdin by default.  Now it must be explicit.

Issue: #27610
2026-02-18 19:50:07 -05:00
Brad King a8cf09d49a PCH: Fix regression in REUSE_FROM that copies the .pdb too often
Since commit 99bdf2ae16 (cmLocalGenerator: add PDB copying dependency on
its script, 2025-06-16, v4.2.0-rc1~481^2~8) the copy is repeated
whenever the copying script is updated.  Avoid updating the copy script
timestamp when it does not change.

Fixes: #27608
2026-02-17 17:14:45 -05:00
Andrew Maher 3f43795df9 FASTBuild: Allow files in different subdirs to be in the same unity bucket
The FASTBuild generator puts source files from different subdirectories
into different `FastbuildObjectListNode` instances. This ensures that
files with the same name will not write to the same object file. A unity
bucket can only contain files from a single `FastbuildObjectListNode`
instance, so a side effect of this logic is that unity buckets can only
contain files in the same subdirectory. This change fixes the problem by
skipping the subdirectory check logic for files with unity enabled.

Fixes: #27457
2026-02-11 14:38:22 -05:00
Brad King 57346991aa Merge topic 'vs-win11-sdk' into release-4.2
6d8ce8b190 VS: Accept Windows 11 SDKs as semantically equivalent to Windows 10 SDKs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11671
2026-02-11 11:53:20 -05:00
Brad King c940e270e6 Merge topic 'fastbuild-imported-objlib' into release-4.2
67dc1dff7c FASTBuild: fix imported object libs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11670
2026-02-10 11:32:07 -05:00
Eduard Voronkin 67dc1dff7c FASTBuild: fix imported object libs
Fixes: #27507
2026-02-10 09:22:09 -05:00
Sylvain Joubert 63165db061 instrumentation: Fix ctest output of Build.xml when targets have labels
Fixes #27585
2026-02-09 18:15:28 +01:00
Brad King 6d8ce8b190 VS: Accept Windows 11 SDKs as semantically equivalent to Windows 10 SDKs
Fixes: #25232
2026-02-09 11:36:29 -05:00
Brad King 57c7fa0d5f Merge topic 'detect-colliding-target-dirs' into release-4.2
bc7fac6ad3 cmGeneratorTarget: detect colliding target directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11658
2026-02-06 10:23:46 -05:00
Ben Boeckel bc7fac6ad3 cmGeneratorTarget: detect colliding target directories
Some projects might get unlucky and have targets which collide in the
sha3-512 hash (truncated to 4) in a directory which also collides in the
same way (easily done by sharing it). Note such problems as potentially
colliding and offer potential remedies.

Also add a test which generates the error.

Closes: #27465
2026-02-05 12:33:56 -05:00
Ben Boeckel e4f6701ad4 cmVisualStudio10TargetGenerator: use language extension for objects
See: #27552
2026-02-04 12:07:53 -05:00
Ben Boeckel 3b9cd510d7 cmVisualStudio10TargetGenerator: only write a single object filename
Fixes: #27552
2026-02-04 12:07:53 -05:00
Brad King 53ae242d55 CMake 4.2.3 2026-01-27 11:03:47 -05:00
Brad King cc05acf0a1 CMake 4.1.5 2026-01-27 10:11:40 -05:00
Brad King fe1fed2f4a CMake 4.0.6 2026-01-27 09:24:22 -05:00
Brad King cd51ca47cb CMake 3.31.11 2026-01-26 13:45:51 -05:00
Brad King 3356d93e66 CMake 4.2.2 2026-01-20 09:46:37 -05:00
Brad King 0c97912756 VS: Fix SLNX generation so .NET Core projects build in the IDE
Extend commit 46b0202ce0 (VS: Fix SLNX generation so CSharp projects
build in the IDE, 2025-10-23, v4.2.0-rc2~26^2) to cover .NET Core
projects.

Fixes: #27524
2026-01-19 15:53:20 -05:00
Brad King 7ce9185792 VS: Add include_external_msproject GUIDs for more project types
Issue: #27524
2026-01-19 15:50:55 -05:00
Brad King ab2ef244bd VS: Add include_external_msproject detection of .njsproj type
It is a NodeJS Project.
2026-01-19 15:50:05 -05:00
Brad King cdbd7bf2f2 Merge topic 'fileapi-instrumentation-initial-cache' into release-4.2
ed023e0cfc Merge branch 'backport-4.0-fileapi-instrumentation-initial-cache'
5b63ea9ad3 instrumentation: Fix crash on cmake_instrumentation() call in initial cache
1bd6e70430 Merge branch 'backport-4.0-fileapi-instrumentation-initial-cache'
bb23f65928 instrumentation: Fix crash on cmake_instrumentation() call in initial cache
8523e579dc Merge branch 'backport-3.31-fileapi-initial-cache'
4d712cfc25 fileapi: Fix crash on cmake_file_api() call in initial cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11598
2026-01-16 09:34:42 -05:00
Brad King bad6ed00e5 Merge topic 'backport-4.0-fileapi-instrumentation-initial-cache' into release-4.1
bb23f65928 instrumentation: Fix crash on cmake_instrumentation() call in initial cache
8523e579dc Merge branch 'backport-3.31-fileapi-initial-cache'
4d712cfc25 fileapi: Fix crash on cmake_file_api() call in initial cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11598
2026-01-16 09:31:27 -05:00
Martin Duffy 5b63ea9ad3 instrumentation: Fix crash on cmake_instrumentation() call in initial cache 2026-01-15 15:14:19 -05:00
Brad King 1bd6e70430 Merge branch 'backport-4.0-fileapi-instrumentation-initial-cache' 2026-01-15 15:14:01 -05:00
Martin Duffy bb23f65928 instrumentation: Fix crash on cmake_instrumentation() call in initial cache 2026-01-15 15:13:34 -05:00
Brad King 8523e579dc Merge branch 'backport-3.31-fileapi-initial-cache' 2026-01-15 15:13:13 -05:00