Commit Graph
38400 Commits
Author SHA1 Message Date
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 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
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
Brad King 8523e579dc Merge branch 'backport-3.31-fileapi-initial-cache' 2026-01-15 15:13:13 -05:00
Martin Duffy 4d712cfc25 fileapi: Fix crash on cmake_file_api() call in initial cache 2026-01-15 14:51:57 -05:00
Clinton Stimpson f51dd918b2 file(GET_RUNTIME_DEPENDENCIES): Support VS 2026 without VS 2022
Find MSVC tools in VS 2026 installation.

This was missed in commit 3392b371 (VS: Add Visual Studio 18 2026
generator, 2025-08-20, v4.2.0-rc1~165^2~1).  Follow the pattern from
commit 235b5fb05b (file(GET_RUNTIME_DEPENDENCIES): Support VS 2022
without VS 2019, 2022-05-19, v3.21.7~3^2).

Fixes: #27511
2026-01-14 10:42:40 -05:00
Brad King 0c2e4d8422 Merge topic 'fix-cmp0199' into release-4.2
35d5a4fd6d GenEx: Partially restore pre-CMP0199 behavior of $<CONFIG>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Matthew Woehlke <matthew.woehlke@kitware.com>
Merge-request: !11581
2026-01-13 11:05:09 -05:00
Brad King acf4ea25e7 Merge topic 'fileapi-windows-implib-missing-error' into release-4.2
c6a940761c fileapi: Handle unused imported libraries with missing IMPORTED_IMPLIB

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11585
2026-01-13 10:32:18 -05:00
Matthew Woehlke 35d5a4fd6d GenEx: Partially restore pre-CMP0199 behavior of $<CONFIG>
Modify the implementation of policy CMP0199 to only remove the oddball
configuration map matching of `$<CONFIG>` in `NEW` mode, restoring the
old behavior of matching BOTH the consumer's configuration and the
selected configuration of the imported target. It turns out that users
are more dependent on the former than the latter, and while matching
more than one thing is still dodgy, we will likely need to introduce a
new generator expression to match the selected configuration of the
imported target.

Meanwhile, `$<CONFIG>` on targets imported from CPS still only matches
the selected configuration of the imported target, which is the behavior
specified by CPS. However, this can only happen for `$<CONFIG>`
expressions that were generated internally during import.

Update documentation and test cases accordingly.

Fixes: #27487
Fixes: #27495
2026-01-12 10:58:08 -05:00
Marc Chevrier a4a5690cd3 CMake: Restore support for compiling as C++11 on Windows
Fixes: #27505
2026-01-12 10:58:07 -05:00
Brad King eba87f1834 Merge topic 'cpack-appimage-user-apprun' into release-4.2
078f28f16b CPack/AppImage: Add support for a custom AppRun file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11577
2026-01-12 09:18:32 -05:00
Brad King 7792c68838 Merge topic 'timeout-after-match-stop-time-behavior' into release-4.2
68beb2e514 Tests/CTestTimeoutAfterMatch: add case for stop time bug
af7427675a cmProcess: compute the timeout when needed
c6940b0dcc cmProcess: explicitly track the StopTimeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11551
2026-01-09 09:58:10 -05:00
Mathieu 078f28f16b CPack/AppImage: Add support for a custom AppRun file
Allow the users to install a custom AppRun file.
Otherwise create a default one.

Fixes: #27478
2026-01-09 09:41:03 -05:00
Craig Scott c6a940761c fileapi: Handle unused imported libraries with missing IMPORTED_IMPLIB
CMake 4.1 and earlier did not issue an error if an imported shared library target
was missing an IMPORTED_IMPLIB property and nothing used that imported
library. There was no code path checking for the CMP0111 NEW behavior. Since
b626843d71 (fileAPI: Output all INTERFACE and IMPORTED targets, 2025-09-13),
we now include all imported targets in the file API replies, and that does trigger
that check. We need to tolerate such imported targets to preserve backward
compatibility, and to avoid issuing errors for problems in targets likely to be
coming from outside the project and beyond the developer's control.

Fixes: #27496
2026-01-10 00:26:55 +11:00
Brad King 4419bf1182 VS: Restore unicode character set for custom targrets on WindowsStore
Restore conditions broken by commit 19a61e56cf (VS: Refactor MSVC
character set selection, 2025-10-10, v4.2.0-rc1~12^2~1).  We had misread
the purpose/scope of the `<= cmStateEnums::OBJECT_LIBRARY` condition.
In the original code it was only about safely indexing `ClOptions`,
not about the kinds of targets that can use a unicode character set.

Fixes: #27490
2026-01-08 11:46:11 -05:00
Brad King ad6643019e Merge topic 'fbuild_i18num_fix' into release-4.2
416d86ab32 FASTBuild: fix configure for non-English MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11557
2026-01-07 10:38:27 -05:00
Ben Boeckel af7427675a cmProcess: compute the timeout when needed
When a timeout is updated during runtime (e.g., via
`TIMEOUT_AFTER_MATCH`), the actual timeout needs recomputed based on
consideration of `StopTimeout` as well. Instead of using `Timeout`
directly, add a `GetComputedTimeout` method which also retrieves the
timeout reason based on which timeout is selected.
2026-01-06 20:47:34 -05:00
Eduard Voronkin 416d86ab32 FASTBuild: fix configure for non-English MSVC
Fixes: #27483
2026-01-06 16:45:38 -05:00
Eduard Voronkin af8771f974 FASTBuild: set PlatformToolset in the generated .bff file
Fixes: #27481
2026-01-06 16:28:04 -05:00
Ben Boeckel c6940b0dcc cmProcess: explicitly track the StopTimeout
When a test can have its timeout reset, the stop time still needs to be
considered when setting the new timeout. Track it explicitly.
2025-12-22 13:34:31 -05:00
Brad King 397d4b796f Merge topic 'sarif-path-encoding' into release-4.2
2eef2baf93 cmake: Fix SARIF diagnostics output path encoding on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11538
2025-12-20 09:30:57 -05:00
Brad King 2eef2baf93 cmake: Fix SARIF diagnostics output path encoding on Windows
Avoid using `filesystem::path` to hold the output path.  It performs
encoding conversions that violate our internal UTF-8 encoding.

Fixes: #27471
Issue: #27472
2025-12-19 14:33:42 -05:00
Brad King b6defd96c9 VS: Restore subsystem link flag for DLLs
In commit 99d09ec45a (VS: Suppress MSBuild default link flags not
specified by project or user, 2025-06-17, v4.1.0-rc1~6^2) we removed our
default `-subsystem:...` link flag from `SHARED` and `MODULE` libraries
in Visual Studio generators for consistency with command-line generators.
However, unlike other flag suppressions for #27004, this change did not
just suppress MSBuild defaults, but actually changed flags the generator
was previously adding itself.

For the linker subsystem flag, consistency across generators should
perhaps achieved by adding the flag in other generators instead of
removing it from Visual Studio generators.  Restore the previous
behavior pending further investigation.

Issue: #27466
Fixes: #27464
2025-12-17 17:41:36 -05:00
Brad King 5ffebf3b67 Merge topic 'linux32-system-libarchive' into release-4.2
cea7f7fc32 Linux: Do not force 64-bit `time_t` on 32-bit archs with system libarchive
16cc3e25d4 Utilities: Select bundled or external dependencies very early

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11505
2025-12-12 09:44:20 -05:00
Brad King 1c3d9cdcdf Merge topic 'stdio-ctrl-c' into release-4.2
c55dfbf656 StdIo: Restore compilation on 32-bit MinGW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11503
2025-12-12 09:42:44 -05:00
Brad King 16cc3e25d4 Utilities: Select bundled or external dependencies very early 2025-12-11 14:40:16 -05:00
Brad King c55dfbf656 StdIo: Restore compilation on 32-bit MinGW
In commit e419429616 (StdIo: Restore Windows Console I/O modes on
Ctrl-C, 2025-11-26, v4.1.4~4^2) we relied on the compiler to generate a
lambda with an `operator()` for each calling convention.  MSVC does
this, but the GNU compiler for MinGW does not seem to.
2025-12-11 10:52:18 -05:00
Brad King 485f11a780 CMake 4.2.1 2025-12-08 13:33:58 -05:00
Brad King 892fad3d23 CMake 4.1.4 2025-12-08 11:30:41 -05:00
Brad King cb16ce6503 Merge topic 'pdb-locations' into release-4.2
cd92cbae7e MSVC: Restore pre-4.2 default PDB paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11475
2025-12-08 10:17:35 -05:00
Brad King 9f1953f1b4 Merge topic 'fastbuild-pdb-quoting' into release-4.2
6f1fe8853d FASTBuild: Fix default MSVC compiler PDB paths
dff020e679 FASTBuild: Add internal helper for intermediate directory creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Eduard Voronkin <edward.voronkin@gmail.com>
Merge-request: !11483
2025-12-08 10:15:55 -05:00
Brad King 7d113b9b84 Merge topic 'vs2019-v142' into release-4.2
8c332a3c7f VS: Restore support for VS 2019 with toolset v142 versions before 14.29

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11480
2025-12-08 09:58:55 -05:00
Ben Boeckel cd92cbae7e MSVC: Restore pre-4.2 default PDB paths
Only force a compile PDB directory when PCH reusing.  This avoids
affecting behavior in unrelated situations.  However, PCH reuse requires
a known path so that the `copy_idb_pdb` logic can accurately generate
the copy instructions so that MSVC's rule that PCH use must use the same
PDB file can be adhered to.

Also revert the test suite adaptations from commit f78f592b78 (pchreuse:
defer target existence enforcement to generation time, 2025-06-16,
v4.2.0-rc1~481^2~4).

Fixes: #27401
2025-12-05 18:10:26 -05:00
Brad King 6f1fe8853d FASTBuild: Fix default MSVC compiler PDB paths
When we pass a PDB output directory to the compiler in a path that
requires quoting, the trailing backslash must be escaped to be parsed
correctly by the compiler, e.g., `cl /Fd"path\with space\\"`.  However,
`fbuild` does not parse this correctly when extracting `/Fd`.  Work
around that bug by using a trailing forward slash in quotes instead.
2025-12-05 18:02:30 -05:00
Brad King dff020e679 FASTBuild: Add internal helper for intermediate directory creation 2025-12-05 15:10:09 -05:00
Brad King 8c332a3c7f VS: Restore support for VS 2019 with toolset v142 versions before 14.29
Since commit 7db3dbddb2 (VS: Suppress MSBuild default flags not
specified by project or user, 2025-06-02, v4.1.0-rc1~69^2) we suppress
the `-Zc:inline` default flag when the project/user does not specify it.
That triggers an apparent bug in VS 2019 with v142 toolset versions
before 14.29 in which MSBuild fails when both `-Zc:inline` and `-nologo`
are suppressed.  This happens when `CMAKE_VERBOSE_MAKEFILE` is enabled,
such as in `try_compile` projects like our builtin compiler inspection.

Since `-nologo` is incidental, avoid suppressing it if `-Zc:inline` is
also suppressed.  Limit this workaround to relevant toolset versions.

Fixes: #27439
2025-12-05 12:47:53 -05:00
Brad King 7e65afff2f Merge topic 'revert-pdb-compile-filename-setting' into release-4.2
809e387a13 cmGeneratorTarget: Revert "always provide a compile PDB filename"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11471
2025-12-03 16:24:25 -05:00
Brad King 809e387a13 cmGeneratorTarget: Revert "always provide a compile PDB filename"
Revert commit 1a8712d31a (cmGeneratorTarget: always provide a compile
PDB filename, 2025-11-24).  It changed our long-standing conditions for
when a naming a compiler-generated `.pdb` file is explicitly named.
It also caused some `BuildDepends` and `RunCMake.BuildDepends` failures
in VS builds that went unnoticed before merging.

Issue: #27401
2025-12-02 17:08:03 -05:00
Brad King e12206b738 Merge topic 'improve-subcommand-message-consistency' into release-4.2
a1a75f4008 cmake_file_api: Improve error message consistency
61143d7cef export: Improve error message consistency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11470
2025-12-02 15:31:59 -05:00
Brad King dd96576e15 Merge topic 'fix-cps-arg-parsing' into release-4.2
41b6b07527 cmExportCommand: Fix PACKAGE_INFO argument parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11459
2025-12-02 15:20:12 -05:00
Matthew Woehlke a1a75f4008 cmake_file_api: Improve error message consistency
Remove literal text "subcommand" from error messages. This addresses the
other use of this and improves consistency (see preceding commit). Also,
omit some unnecessary articles, which also improves consistency.
2025-12-01 15:52:36 -05:00