Commit Graph

35084 Commits

Author SHA1 Message Date
Brad King
dd4a6dff92 Link explicitly to private transitive dependencies on stub libraries
We represent stub libraries, e.g., for CUDA, using imported `SHARED`
library targets with only `IMPORTED_IMPLIB`, and no `IMPORTED_LOCATION`,
to indicate that the stub file is meant only for linkers and not dynamic
loaders.  See commit 7351d590ee (cmTarget: Add a way to represent
imported shared library stubs, 2023-07-17, v3.28.0-rc1~344^2) and commit
fc6508921c (cmComputeLinkInformation: Restore soname lookup for
non-imported targets, 2023-12-05, v3.28.0~4^2).

If a shared library is linked to a stub, it has a `NEEDED` field
populated with the `SONAME` found in the stub.  When a dependent target
links to such a shared library, some linkers want to find a library file
on disk and load it to see what symbols it provides.  This is necessary
for linkers that enforce `--no-allow-shlib-undefined`.  On hosts with
only the stub library installed, e.g., with only the CUDA toolkit
development package, the real runtime library corresponding to the
stub's `SONAME` may not even exist, so no `-rpath-link` flag can help
linkers find it.  Pass the stub library to linkers explicitly so they
can find it without searching.
2024-01-04 11:59:26 -05:00
Kitware Robot
31dead97ed CMake Nightly Date Stamp 2024-01-04 00:01:11 -05:00
Brad King
040ee747c3 Merge topic 'cxxmodules-no-compile-commands-modmap'
eebf239d9c Merge branch 'cxxmodules-no-compile-commands-modmap-release' into cxxmodules-no-compile-commands-modmap
73fbad3d93 cmNinjaTargetGenerator: use scan flag for modmap usage in exported commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9100
2024-01-03 13:53:05 -05:00
Craig Scott
4a76154e05 Merge topic 'cxxmodules-error-message-improvement'
4962eba981 cmDyndepCollation: clarify CXX_MODULES-without-BMI error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Yaraslau <yaraslau.tamashevich@gmail.com>
Merge-request: !9103
2024-01-03 07:19:09 -05:00
Kitware Robot
63cd112063 CMake Nightly Date Stamp 2024-01-03 00:01:06 -05:00
Kitware Robot
9841c4d879 CMake Nightly Date Stamp 2024-01-02 00:01:06 -05:00
Kitware Robot
bd20084b6a CMake Nightly Date Stamp 2024-01-01 00:01:33 -05:00
Kitware Robot
aea1365e6f CMake Nightly Date Stamp 2023-12-31 00:01:06 -05:00
Kitware Robot
76b585ecc8 CMake Nightly Date Stamp 2023-12-30 00:01:06 -05:00
Kitware Robot
8dc21f4b5a CMake Nightly Date Stamp 2023-12-29 00:01:05 -05:00
Ben Boeckel
eebf239d9c Merge branch 'cxxmodules-no-compile-commands-modmap-release' into cxxmodules-no-compile-commands-modmap
* cxxmodules-no-compile-commands-modmap-release:
  cmNinjaTargetGenerator: use scan flag for modmap usage in exported commands
2023-12-28 10:58:35 -05:00
Kitware Robot
158ecdced2 CMake Nightly Date Stamp 2023-12-28 00:01:06 -05:00
Kitware Robot
74f1e6612e CMake Nightly Date Stamp 2023-12-27 00:01:05 -05:00
Ben Boeckel
4962eba981 cmDyndepCollation: clarify CXX_MODULES-without-BMI error message
Fixes: #25493
2023-12-26 11:07:15 -05:00
Kitware Robot
b2ea53f484 CMake Nightly Date Stamp 2023-12-26 00:01:10 -05:00
Kitware Robot
0064ac4a55 CMake Nightly Date Stamp 2023-12-25 00:01:28 -05:00
Kitware Robot
1e37448710 CMake Nightly Date Stamp 2023-12-24 00:01:07 -05:00
Marc Chevrier
179c036b5d Merge topic 'Ninja-LINK_OPTIONS-with-newlines'
255c2e1430 Ninja: LINK_OPTIONS property should support newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9096
2023-12-23 05:39:10 -05:00
Kitware Robot
6d578ab5f8 CMake Nightly Date Stamp 2023-12-23 00:01:06 -05:00
Ben Boeckel
73fbad3d93 cmNinjaTargetGenerator: use scan flag for modmap usage in exported commands
See: https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968
2023-12-22 16:18:18 -05:00
Kitware Robot
421cc38a54 CMake Nightly Date Stamp 2023-12-22 00:01:04 -05:00
Kitware Robot
f8b165dcd6 CMake Nightly Date Stamp 2023-12-21 00:01:06 -05:00
Marc Chevrier
255c2e1430 Ninja: LINK_OPTIONS property should support newlines
Fixes: #25513
2023-12-20 17:05:09 +01:00
Brad King
30a56df0a8 Merge topic 'cmake-presets-empty-architecture'
0654051dde CMakePresets.json: Don't use architecture and toolset if empty

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9093
2023-12-20 09:11:20 -05:00
Brad King
a350d92c06 Merge topic 'add_test-CROSSCOMPILING_EMULATOR-exclusive'
ca5a300d7f add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8947
2023-12-20 09:09:48 -05:00
Brad King
5c1990fc51 Merge topic 'swift-CMP0157-old'
d31b48816c Swift/Ninja: Fix missing OFM in CMP0157 OLD behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9089
2023-12-20 09:08:53 -05:00
Kitware Robot
1191f642c0 CMake Nightly Date Stamp 2023-12-20 00:01:08 -05:00
Kyle Edwards
0654051dde CMakePresets.json: Don't use architecture and toolset if empty
Fixes: #24864
2023-12-19 10:19:03 -05:00
Ralf Habacker
ca5a300d7f add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compiling
Add policy CMP0158 to provide compatibility for existing projects.

Fixes: #23672
2023-12-19 10:00:55 -05:00
Brad King
49dc6a44e0 Merge topic 'Xcode-Check-Imported-Framework'
defbfd6f55 Xcode: Restore support for standalone IMPORTED_LOCATION_<CONFIG>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9082
2023-12-19 08:04:01 -05:00
Kitware Robot
2cad910ecb CMake Nightly Date Stamp 2023-12-19 00:01:06 -05:00
Evan Wilde
d31b48816c Swift/Ninja: Fix missing OFM in CMP0157 OLD behavior
The CMP0157 old behavior omitted the output-file-map after the Swift
build split because we stopped calling `EmitSwiftDependencyInfo` when we
could not split the build because we didn't call
`WriteObjectBuildStatement`. If we can't split the build, then we still
need to include the OFM information to not break incremental builds.
2023-12-18 19:42:53 -08:00
Marc Chevrier
defbfd6f55 Xcode: Restore support for standalone IMPORTED_LOCATION_<CONFIG>
In commit 878ae03832 (macOS: IMPORTED framework: Honor SYSTEM target
property in all cases, 2023-08-27, v3.28.0-rc1~162^2) we broke support
for `IMPORTED_LOCATION_<CONFIG>` without `IMPORTED_CONFIGURATIONS`.
Previously it worked if the importing project's configurations match the
set of `IMPORTED_LOCATION_<CONFIG>` properties set.  Fix that case.

Fixes: #25506
Issue: #25515
2023-12-18 10:18:25 -05:00
Kitware Robot
43e6d30061 CMake Nightly Date Stamp 2023-12-18 00:01:56 -05:00
Kitware Robot
daf8da8c80 CMake Nightly Date Stamp 2023-12-17 00:01:07 -05:00
Brad King
ba41ca758a Merge topic 'swift-split-compilation-model'
9bed4f4d81 Swift/Ninja: Split compilation model
64b3367845 cmGlobalGenerator: Allow passing language to GetLangaugeOutputExtension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8907
2023-12-16 07:15:41 -05:00
Kitware Robot
316bb67ff7 CMake Nightly Date Stamp 2023-12-16 00:01:08 -05:00
Brad King
6ba3bb0563 Merge topic 'cmake-test-launcher'
88863d83d6 fileapi: Add test launcher to codemodel-v2
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
478a5f4e04 fileapi: Make launcher attribute 'arguments' optional
b44e38a397 cmFileAPICodemodel: Add missing std::move()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8963
2023-12-15 09:34:20 -05:00
Evan Wilde
9bed4f4d81 Swift/Ninja: Split compilation model
Splitting the Swift build into an object build and a separate link step,
instead of building and linking in one step. The immediate benefit is
LSP support because we are able to emit compile-commands for Swift files
now. Additionally, it is possible to specify flags to the compile step,
enabling folks to emit C and C++ headers from their Swift builds for
C/C++ interop, without needing custom commands. Eventually, this gives
us a path toward working object libraries.

Object Libraries:
 - Object libraries don't work today because CMake doesn't emit targets
   for object libraries into the Ninja build file.
 - tl;dr: Object libraries work if they aren't WMO. Still need work to
   make WMO'd object libraries work.

   Object libraries still don't completely work with this patch because,
   while we emit the targets, the `TARGET_OBJECTS` generator expression
   expansion has a separate mechanism for determining what the names of
   the objects are based on the input source files, so targets that
   depend on an object library built with a whole-module optimization
   will depend on objects based on the name of the source file instead
   of the actual emitted object file.

These features require being able to accurately model wholemodule builds
though, because we actually need to track object files and WMO affects
what objects are emitted. For that, we require CMP0157 use the NEW
policy. When it's OLD, we have to fall back on the old behavior and
cannot provide object libraries or the compile-commands for LSP.

Issue: #25308
2023-12-15 05:51:13 -08:00
Kitware Robot
dc4ce42b66 CMake Nightly Date Stamp 2023-12-15 00:01:05 -05:00
Brad King
1eed682d7c CMake 3.28.1 2023-12-14 10:47:27 -05:00
Kitware Robot
889dd287d3 CMake Nightly Date Stamp 2023-12-14 00:01:05 -05:00
Ralf Habacker
88863d83d6 fileapi: Add test launcher to codemodel-v2
We do not need to bump the minor version because it was recently bumped
by addition of the cross-compiling emulator as another kind of launcher.
2023-12-13 10:20:43 -05:00
Ralf Habacker
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
Add a `CMAKE_TEST_LAUNCHER` variable and corresponding `TEST_LAUNCHER`
target property.

Issue: #23672
2023-12-13 10:20:43 -05:00
Ralf Habacker
478a5f4e04 fileapi: Make launcher attribute 'arguments' optional
This was missed in commit 80a64c9ce5 (fileapi: Add cross-compiling
emulator to codemodel-v2, 2023-11-11).
2023-12-13 10:20:41 -05:00
Ralf Habacker
b44e38a397 cmFileAPICodemodel: Add missing std::move()
This was missed in commit 80a64c9ce5 (fileapi: Add cross-compiling
emulator to codemodel-v2, 2023-11-11).
2023-12-13 10:19:38 -05:00
Kitware Robot
3f1a2c8d52 CMake Nightly Date Stamp 2023-12-13 00:01:05 -05:00
Brad King
9642647646 Merge topic 'create_test_sourcelist-full-filepath'
a29ca55b1f create_test_sourcelist: use the full path to the driver
609af7734f cmCreateTestSourceList: simplify string operations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9060
2023-12-12 08:41:57 -05:00
Brad King
dbede7be7e Merge topic 'cmake-sources-no-scan'
91b7bf59a7 cmGlobalXCodeGenerator: disable C++ module scanning for force-lang files
9e19a61ddb cmLocalGenerator: disable C++ module scanning for unity sources
fa9a72a788 cmLocalGenerator: disable C++ module scanning for copied PCH sources
e5dce1a37e cmQtAutoGenInitializer: disable C++ module scanning for autogen sources
4fd596c34c cmGeneratorTarget: disable C++ module scanning for verify targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9064
2023-12-12 08:33:38 -05:00
Kitware Robot
9be8198bcc CMake Nightly Date Stamp 2023-12-12 00:01:04 -05:00