Commit Graph

63634 Commits

Author SHA1 Message Date
Ben Boeckel ea8c37b759 Tests/CXXModules: add a test which scans a PCH-using source
This tests that PCH usage works with scanning logic.
2023-12-04 07:20:36 -05:00
Brad King 8bd78627dd CMake 3.28.0-rc6 v3.28.0-rc6 2023-11-30 13:13:15 -05:00
Brad King e1df218f4b Merge topic 'execute_process-no-extension' into release-3.28
f6d2efa752 Tests: Add case to cover execute_process support for no extension on Windows
da9df7425a libuv: win/spawn: run executables with no file extension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9017
2023-11-30 13:09:05 -05:00
Kyle Edwards f6d2efa752 Tests: Add case to cover execute_process support for no extension on Windows
Issue: #25450
2023-11-30 09:59:36 -05:00
Kyle Edwards da9df7425a libuv: win/spawn: run executables with no file extension
Backport this commit from libuv PR 4241 to restore `execute_process()`
support for running executables on Windows with no file extension.

Fixes: #25450
2023-11-30 09:59:36 -05:00
Brad King 6a49dc0391 Merge topic 'rpm-quoting' into release-3.28
5123e9e160 ci: unmask RPM tests on Fedora 39
bf22ac5263 CPack/RPM: Quote paths in rpm spec only if they have whitespace
75ea6207b7 CPack/RPM: Factor out helper to quote paths in generated rpm spec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9005
2023-11-30 09:05:53 -05:00
Brad King d2167f7224 Merge topic 'ccmake-install-rds-crash' into release-3.28
d01120a47a cmGlobalGenerator: clear RuntimeDependencySet members at configure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9013
2023-11-30 09:03:50 -05:00
Ben Boeckel 5123e9e160 ci: unmask RPM tests on Fedora 39 2023-11-29 12:47:45 -05:00
Brad King bf22ac5263 CPack/RPM: Quote paths in rpm spec only if they have whitespace
RPM supports either whitespace with quoting or globbing without quoting.
Prior to RPM 4.19 it accepted globbing in quotes, but it only globbed
correctly without whitespace, where quoting was not necessary anyway.
Starting in RPM 4.19, glob characters in quotes are considered literal.

Fixes: #25421
Inspired-by: Ben Boeckel <ben.boeckel@kitware.com>
See: https://github.com/rpm-software-management/rpm/commit/d44114f007f54f205ffa13d22724199fe50a137a
2023-11-29 12:47:20 -05:00
Brad King 75ea6207b7 CPack/RPM: Factor out helper to quote paths in generated rpm spec 2023-11-29 12:27:31 -05:00
Ben Boeckel d01120a47a cmGlobalGenerator: clear RuntimeDependencySet members at configure
Commit f2617cf8e6 (Source: Add cmInstallRuntimeDependencySet,
2021-05-19) introduced via !6186 to 3.21 added storage to the global
generator for runtime dependency sets. However, this was not cleared at
the start of configure in the `ClearGeneratorMembers()` method. When
using `ccmake` to configure (and, presumably `cmake-gui` too), projects
using `install(TARGETS … RUNTIME_DEPENDENCY_SET)` would use dependency
set tracking instances from previous configure runs that held references
to targets free'd with the `cmMakefile` instance that held them.

Clear the dependency sets at the beginning of configure so that they are
not remembered and trigger via use-after-free bugs when used.

Fixes: #25446
2023-11-29 08:34:21 -05:00
Brad King 1b82da7e15 Merge topic 'cxxmodules-diagnostics' into release-3.28
cbd549b09e cxxmodules: Add more suggestions to no-modules-support diagnostics

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9011
2023-11-29 07:51:41 -05:00
Brad King 503aa3c3cc Merge topic 'xcode-embed-resources' into release-3.28
6030df205a Xcode: Fix embed resources prop name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Deal <halx99@live.com>
Merge-request: !9008
2023-11-29 07:50:02 -05:00
Brad King cbd549b09e cxxmodules: Add more suggestions to no-modules-support diagnostics
Tell users what generators *do* support C++ modules.  Report the current
generator to make clear it is not one of those supporting modules.
Also clarify the purpose of the existing documentation references.
2023-11-28 14:36:16 -05:00
halx99 6030df205a Xcode: Fix embed resources prop name
Fix commit e40d2cb3af (Xcode: Add embed resources support, 2023-07-31,
v3.28.0-rc1~281^2).  The implementation should not name the `_PATH`
suffix explicitly.  That variant is automatically handled by
`cmGlobalXCodeGenerator::AddEmbeddedObjects`.
2023-11-28 12:06:29 -05:00
Brad King 01deb58098 Merge branch 'release-3.27' into release-3.28 2023-11-28 10:38:54 -05:00
Brad King c4f7eb3f0b CMake 3.27.9 v3.27.9 2023-11-28 09:52:37 -05:00
Brad King 0ff8c20932 Merge branch 'release-3.27' into release-3.28 2023-11-27 14:30:53 -05:00
Brad King a4cfa9f017 Merge branch 'release-3.26' into release-3.27 2023-11-27 14:30:37 -05:00
Brad King ceb742a8fb CMake 3.26.6 v3.26.6 2023-11-27 13:48:12 -05:00
Brad King ee66ca617d Merge branch 'release-3.27' into release-3.28 2023-11-27 08:38:49 -05:00
Brad King e332f7f666 Merge branch 'revert-exact-collation-depends-3.27' into release-3.27
Merge-request: !8996
2023-11-27 08:38:19 -05:00
Brad King 4b2960b1f3 Merge topic 'fortran-objects-as-sources-fix' into release-3.28
beb1393f8f Merge branch 'revert-exact-collation-depends-3.27' into fortran-objects-as-sources-fix
a033dce326 Makefiles: provide, but do not consume, "forward linked" target dirs
7cd0adab1b cmCommonTargetGenerator: use modules from linked object-referenced targets
1175f1c874 LinkItem: track `cmSourceFile` instances for external objects
d2fa56772f Ninja: support "forwarding" modules from other targets
ec1e589bec Ninja: Revert exact collation dependencies for 3.27
06df59b930 cmCommonTargetGenerator: return forward linked target dirs too
f8729ab366 cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modules
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8989
2023-11-27 08:36:44 -05:00
Ben Boeckel beb1393f8f Merge branch 'revert-exact-collation-depends-3.27' into fortran-objects-as-sources-fix
* revert-exact-collation-depends-3.27:
  Fortran: Revert exact collation dependencies for 3.27
2023-11-23 14:26:55 -05:00
Ben Boeckel a033dce326 Makefiles: provide, but do not consume, "forward linked" target dirs
Makefiles do not have a per-object sense of where they come from, so
forwarding any module information here would end up with incorrect
module file path construction by consuming targets. Leave a TODO item in
its place.
2023-11-23 14:26:31 -05:00
Ben Boeckel 7cd0adab1b cmCommonTargetGenerator: use modules from linked object-referenced targets
Fortran modules provided by objects added as linked items via
`$<TARGET_OBJECTS>` should also be considered as "linked targets" for
collation purposes. As C++ modules have their own visibility rules
through their `FILE_SET` feature, do not expose these for C++ module
collation.
2023-11-23 14:26:31 -05:00
Ben Boeckel 1175f1c874 LinkItem: track cmSourceFile instances for external objects
The target may be required in order to provide Fortran modules, so track
the source file so that the target may be looked up when needed.
2023-11-23 14:26:31 -05:00
Ben Boeckel d2fa56772f Ninja: support "forwarding" modules from other targets
When a target uses objects from another target which provides modules as
sources, the modules provided by the referenced target must also be
treated as if they were provided by the referencing target. Add the
concept of "forwarding" modules so that consumers can use modules
created by these sources as well.

Note that this is only sensible for Fortran where module usages are
implicit as far as CMake's visibility model is concerned. C++ modules
have their own concept of visibility which does not require or support
such `$<TARGET_OBJECTS>` reuse in this way.
2023-11-23 14:25:09 -05:00
Brad King 66149dd1a9 Merge branch 'release-3.27' into release-3.28 2023-11-22 07:22:21 -05:00
Brad King 34afeb625f Merge branch 'release-3.26' into release-3.27 2023-11-22 07:22:11 -05:00
Brad King 1d431e440d Merge topic 'doc-ctest-link-cdash' into release-3.28
486c89dd6a Help: Fix ctest(1) manual links to www.cdash.org

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8998
2023-11-22 07:21:15 -05:00
Brad King cf2f2dfe63 Merge topic 'clang-scan-deps-failed-scan' into release-3.28
77a7edb73f Clang-CXX: copy into the dyndep output on success

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Namniav W <namniav@gmail.com>
Merge-request: !8991
2023-11-22 07:20:04 -05:00
Brad King 5c5830bb9e Merge branch 'doc-ctest-link-cdash' into release-3.27
Merge-request: !8998
2023-11-21 18:53:15 -05:00
Brad King 569c1d1b6e Merge branch 'doc-ctest-link-cdash' into release-3.26
Merge-request: !8998
2023-11-21 18:52:31 -05:00
Brad King 486c89dd6a Help: Fix ctest(1) manual links to www.cdash.org
When the link was updated to `https` by commit 52eac4573d (Help: Fix
link to cdash.org from CTest manual, 2021-04-21, v3.21.0-rc1~262^2~2)
the markup was incorrectly adjusted to show the link as part of the
"See Also" section.  It is meant to be the link destination for links
in prose elsewhere in the manual.  Fix the markup and move it to a
clearer location.  Also update the link to resolve a redirect.
2023-11-21 18:46:41 -05:00
Ben Boeckel ec1e589bec Ninja: Revert exact collation dependencies for 3.27
Revert commit b6a5382217 (Ninja: depend on language module information
files directly, 2023-02-10, v3.27.0-rc1~502^2) from !8197.

This reverts the "exact dependencies" for collation inputs and returns
to "get all targets" and target-ordering. Use of exact dependencies
caused a parade of use cases that had not been tested previously to be
found and need fixing over the 3.27 release series. To stop the flow on
3.27, revert to the 3.26 strategy.  We will continue in 3.28.

Note that this is a restoration of 3.26 semantics where incremental
rebuilds may be subtly incorrect in the presence of stale
`<LANG>Modules.json` files. However, since C++ support is experimental
and Fortran has always had this problem as of 3.27, it is not considered
a regression.

See: #25112
See: #25123
See: #25252
See: #25365
See: #25417
See: #25425
2023-11-21 11:09:38 -05:00
Ben Boeckel 06df59b930 cmCommonTargetGenerator: return forward linked target dirs too
This will be used for module forwarding in order to support
`$<TARGET_OBJECTS>` usage in source and link libraries calls.
2023-11-21 09:44:39 -05:00
Ben Boeckel f8729ab366 cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modules
Targets only using Fortran modules via `$<TARGET_OBJECTS>` also need a
collation step to be performed. Check for this case and trigger the
depends rule to be used.
2023-11-21 09:43:49 -05:00
Ben Boeckel 6afe841e62 cmNinjaTargetGenerator: handle object-referencing Fortran modules
Targets only using Fortran modules via `$<TARGET_OBJECTS>` also need a
collation step to be performed. Check for this case and trigger the
collation rule to be added and used.
2023-11-21 09:43:47 -05:00
Ben Boeckel c1fc5455b1 cmGeneratorTarget: also check included objects for Fortran modules
Fortran modules provided by objects in `$<TARGET_OBJECTS>` should also
count as "has Fortran modules" for the target referencing the objects.
2023-11-21 09:43:17 -05:00
Ben Boeckel 515ca5fcd1 cmCommonTargetGenerator: use modules from object-referenced targets
Fortran modules provided by objects added as sources via
`$<TARGET_OBJECTS>` should also be considered as "linked targets" for
collation purposes. As C++ modules have their own visibility rules
through their `FILE_SET` feature, do not expose these for C++ module
collation.
2023-11-21 09:42:58 -05:00
Ben Boeckel d8182105a1 cmGeneratorTarget: add a query for targets with objects in the source list
This will be eventually be used to inform the collator of this
information so that Fortran modules provided by the resulting objects
can also be used as intended.
2023-11-21 09:42:58 -05:00
Ben Boeckel ee4e85e615 cmGeneratorTarget: use pointers to const generator targets for languages 2023-11-21 09:42:58 -05:00
Ben Boeckel b34a8fcb8e cmGeneratorTarget: track object libraries using a set
This avoids having to do manual "is already present" checks. The order
the targets are processed does not need to be preserved because the
resulting `languages` result is already a `set`.
2023-11-21 09:42:58 -05:00
Ben Boeckel 6fe8b84894 Merge branch 'revert-exact-collation-depends-3.27' (early part) into fortran-objects-as-sources-fix
* 'revert-exact-collation-depends-3.27' (early part):
  Tests/FortranModules: add test for TARGET_OBJECTS-as-linked-items module usage
  Tests/FortranModules: add test for TARGET_OBJECTS-as-sources module usage
2023-11-21 09:42:27 -05:00
Ben Boeckel 77a7edb73f Clang-CXX: copy into the dyndep output on success
When `clang-scan-deps` fails to scan (e.g., bad source syntax, junk
flags, etc.), the redirection unconditionally updates the file. If this
fails, the `.ddi` file timestamp is updated. If the state is then
reverted (e.g., the command line returns to the state of the last
successful build), the updated file is not useful, but `ninja` does not
rerun because:

- the command hash matches the last successful run
- the output file is newer than its inputs

However, since the `.ddi` file has been updated with bogus contents from
a failed scan, collation fails as the `rules` array is empty (or
incomplete from a batch scan).

If `clang-scan-deps` were properly aware of its output file, it could
use this to not write the file if any inner scan fails. Requested in
https://github.com/llvm/llvm-project/issues/72875.

See: https://github.com/llvm/llvm-project/issues/72875
Fixes: #25429
2023-11-21 09:41:59 -05:00
Ben Boeckel 9d2769ecbd Tests/FortranModules: add test for TARGET_OBJECTS-as-linked-items module usage
Test module usage across a `$<TARGET_OBJECTS>`-as-linked-items use case.

See: #25425
2023-11-21 09:17:43 -05:00
Ben Boeckel 7c1e52be87 Tests/FortranModules: add test for TARGET_OBJECTS-as-sources module usage
Test module usage across a `$<TARGET_OBJECTS>`-as-sources use case.

See: #25425
2023-11-21 09:17:36 -05:00
Brad King 11a2fd6cca Merge branch 'release-3.27' into release-3.28 2023-11-20 09:13:31 -05:00
Brad King 87dab04aee Merge branch 'release-3.26' into release-3.27 2023-11-20 09:13:24 -05:00