Commit Graph

13741 Commits

Author SHA1 Message Date
Brad King
ba5f8dbba3 LinkerId: Use empty string for unknown linker id
Since commit c26c6ac488 (Link Step: compute effective linker used by the
compiler, 2023-05-27) we used `UNKNOWN` if the linker id is not known.
This convention is not used elsewhere, and logic using the linker id
is easier when `if(CMAKE_C_COMPILER_LINKER_ID)` is false on unknown id.
2024-01-03 17:07:52 -05:00
Brad King
6cbd0658c5 LinkerId: Match Apple linker on all Apple platforms
`cmake_determine_linker_id` is only used for macOS because Apple device
platforms set `_CMAKE_FEATURE_DETECTION_TARGET_TYPE` to `STATIC_LIBRARY`,
but we might as well prepare for them anyway.
2024-01-03 17:07:52 -05:00
Brad King
9324668517 LinkerId: Fix detection of GNU linker id without parenthesis in version output 2024-01-03 17:07:52 -05:00
Brad King
37bc148870 LinkerId: Fix detection of linker tool without path
Some compiler drivers invoke the linker tool as just `ld`, with no path,
expecting it to be in the `PATH`.
2024-01-03 17:07:52 -05:00
Brad King
6e527c2d38 LinkerId: Fix detection of linker tool for Clang on OpenBSD
Do not match quotes as part of the path.
2024-01-03 17:07:51 -05:00
Brad King
455aed3061 LinkerId: Fix detection of linker tool for MSVC
Previously we matched an entire build system output line and then
extracted the relevant portion in a separate brittle step.  Match
it directly.  Use the `CMAKE_LINKER` value directly if available.
2024-01-03 17:05:55 -05:00
Brad King
78b7ba6494 LinkerId: Fix detection of linker tool for GNU on SunOS sparc32
We do not use `-Wl,-v` on SunOS because not all GNU deployments use the
`collect2` helper, and those that do do not always print the underlying
`ld` command line.  Parse the `--with-ld=` option as a fallback.
2024-01-03 16:24:58 -05:00
Brad King
dd480e5be5 LinkerId: Fix detection of linker tool for XL compilers
These compilers print an explicit `export XL_LINKER=` line.
Parse it separately.
2024-01-03 16:24:58 -05:00
Brad King
262de2ad92 LinkerId: Fix detection of linker tool for XL as nvcc host compiler
When IBM XL is used as the host compiler for nvcc, it generates a
comma-separated link line.  Parse the `exec:` line syntax separately, as
was done in commit b5f20da94d (CMakeParseImplicitLinkInfo supports comma
separated link lines, 2019-08-23, v3.16.0-rc1~181^2).
2024-01-03 16:24:57 -05:00
Brad King
a80dca88a1 LinkerId: Prepare detection of linker tool for multiple match attempts 2024-01-03 16:24:57 -05:00
Brad King
edb10c5325 Merge topic 'package-dispatch-apple'
1dd4a9baff Tests: Cover generate_apple_platform_selection_file on all platforms
3148db4533 CMakePackageConfigHelpers: Fix Apple platform selection for tvOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9077
2023-12-18 10:56:43 -05:00
Craig Scott
50e8791f92 Merge topic 'fc-provider-find-package-args'
0415304970 FetchContent: Fix FIND_PACKAGE_ARGS not being passed to dep providers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9080
2023-12-17 15:43:00 -05:00
Craig Scott
b7ad9bd8f3 Merge topic 'doc-fc-fully-disconnected'
18c514a86d Help: Add note not to use FETCHCONTENT_FULLY_DISCONNECTED on first run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9081
2023-12-17 15:38:06 -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
Craig Scott
18c514a86d Help: Add note not to use FETCHCONTENT_FULLY_DISCONNECTED on first run
Fixes: #25481
2023-12-16 20:36:26 +11:00
Craig Scott
0415304970 FetchContent: Fix FIND_PACKAGE_ARGS not being passed to dep providers
Fixes: #25504
2023-12-16 16:42:00 +11:00
Brad King
3148db4533 CMakePackageConfigHelpers: Fix Apple platform selection for tvOS
Fix the tvOS SDK name in commit 37bc3400cd (CMakePackageConfigHelpers:
Add generate_apple_platform_selection_file(), 2023-11-03).
2023-12-15 16:33:22 -05:00
Brad King
d901c4aa95 Merge topic 'FindCUDAToolkit-cupti'
04959e0285 Tests: Verify CUDA::cupti existence on a subset of machines
09a3c8b46b CUDAToolkit: Correctly search all include paths from compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9072
2023-12-15 09:32:00 -05:00
Brad King
762e3109a0 Merge topic 'FindBoost-1.84'
9dc0392df0 FindBoost: Add support for Boost 1.84

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9075
2023-12-15 09:30:56 -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
Robert Maynard
09a3c8b46b CUDAToolkit: Correctly search all include paths from compiler
The CUDAToolkit usage of `find_path( PATHS )` was incorrectly
quoting a list of paths causing none of them to be used.
2023-12-14 14:04:53 -05:00
Brad King
9dc0392df0 FindBoost: Add support for Boost 1.84
Update the list of known versions.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_84_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.84.0 source tree.
They are the same as 1.83's dependencies, so just update
the version check for warning about newer versions.

Fixes: #25499
2023-12-14 11:35:26 -05:00
Brad King
654cc4c25d Merge topic 'FindMatlab-version'
0f6e9d0658 FindMatlab: Fix processing of multiple versions from Windows Registry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9074
2023-12-14 10:46:30 -05:00
Brad King
a76bb5f865 Merge topic 'FindMatlab-version' into release-3.28
0f6e9d0658 FindMatlab: Fix processing of multiple versions from Windows Registry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9074
2023-12-14 10:46:29 -05:00
Brad King
0f6e9d0658 FindMatlab: Fix processing of multiple versions from Windows Registry
Fix logic from commit fff5c1507e (FindMatlab: refactor: use registry
query instead of execute_process, 2023-09-14, v3.28.0-rc1~82^2~7)
to work when multiple versions are found in the registry.

Issue: #25497
2023-12-14 10:35:56 -05:00
Brad King
32cd449eec Merge topic 'FindTIFF-pre-CMP0057'
84930e9a4c FindTIFF: Restore support for projects that do not enable CMP0057

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9073
2023-12-14 10:02:50 -05:00
Brad King
84930e9a4c FindTIFF: Restore support for projects that do not enable CMP0057
Since commit 6a3059e66f (FindTIFF: bridge `tiff-config` into
FindTIFF-compatible interface, 2023-09-14, v3.28.0-rc1~87^2) we use the
`if(IN_LIST)` test that required CMP0057.  Expand the scope over which
we enable that policy explicitly.

Issue: #25485
2023-12-14 09:43:08 -05:00
Brad King
01eb3f01b7 Merge topic 'FindFreetype-use-config'
828df1d9e4 FindFreetype: Fix success message when config module is found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9071
2023-12-14 09:16:29 -05:00
Brad King
828df1d9e4 FindFreetype: Fix success message when config module is found
Follow up commit d892dedf22 (FindFreetype: always find the config module
quietly, 2023-12-13) with a fix to the FPHSA call that reports success.

Fixes: #25485
2023-12-14 09:06:07 -05:00
Brad King
d4eb72a3f6 Merge topic 'FindMatlab-version'
ef64c118de FindMatlab: Fix regression on Windows Registry lookup failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9070
2023-12-14 08:30:02 -05:00
Brad King
3d1fbc4f6b Merge topic 'FindMatlab-version' into release-3.28
ef64c118de FindMatlab: Fix regression on Windows Registry lookup failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9070
2023-12-14 08:30:00 -05:00
Brad King
4d45fbd56a Merge topic 'Find-CONFIG-chain-fixes'
581acbce52 FindTIFF: consider `IMPLIB`-using platforms
e8e7d9f775 FindTIFF: always find the config module quietly
a575bebf0d FindFreetype: also consider RelWithDebInfo-built libraries
d892dedf22 FindFreetype: always find the config module quietly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9068
2023-12-14 08:28:25 -05:00
Brad King
ef64c118de FindMatlab: Fix regression on Windows Registry lookup failure
Fix logic from commit dc9d9589e4 (FindMatlab:WIN32: return full Matlab
version when found via registry, 2023-09-14, v3.28.0-rc1~82^2~2) to
avoid assuming that a registry entry always exists and is non-empty.

Fixes: #25497
2023-12-14 08:12:13 -05:00
Ben Boeckel
581acbce52 FindTIFF: consider IMPLIB-using platforms
Support multi-config-providing and `IMPLIB`-using deployments with the
`tiff-config` trampoline code. Follow the pattern used in `FindFreetype`
by commit ae9890cd36 (FindFreeType: consider `IMPLIB`-using platforms,
2023-10-26, v3.28.0-rc4~10^2~3).

See: #25485
2023-12-13 13:12:45 -05:00
Ben Boeckel
e8e7d9f775 FindTIFF: always find the config module quietly
When the config module is not present, a spurious "tiff not found" is
output before the pre-existing logic is used. Instead, silence the
module and use FPHSA to report as-if `TIFF` did the search.

Fixes: #25485
2023-12-13 13:12:45 -05:00
Ben Boeckel
a575bebf0d FindFreetype: also consider RelWithDebInfo-built libraries 2023-12-13 13:12:45 -05:00
Ben Boeckel
d892dedf22 FindFreetype: always find the config module quietly
When the config module is not present, a spurious "freetype not found"
is output before the pre-existing logic is used. Instead, silence the
module and use FPHSA to report as-if `Freetype` did the search.

See: #25485
2023-12-13 11:28:18 -05:00
Josh Channings
fccb1d3a36 ADSP: Use compiler-reported preprocessor dependencies 2023-12-12 17:44:25 +00:00
Brad King
84a3e839ec Merge topic 'FindOpenGL-macOS-x11'
1dbfe638da FindOpenGL: Document how to use macOS X11 OpenGL
a13f62427b FindOpenGL: Clarify cache entry doc strings on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9062
2023-12-12 08:43:25 -05:00
Brad King
c4a5806fd3 Merge topic 'bug/fix_cupti_regression'
f69b9b7305 CUDAToolkit: Restore ability to find cupti headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Misha Chornyi <mchornyi@nvidia.com>
Merge-request: !9054
2023-12-12 08:36:27 -05:00
Brad King
7cbf1f7a58 Merge topic 'bug/fix_cupti_regression' into release-3.28
f69b9b7305 CUDAToolkit: Restore ability to find cupti headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Misha Chornyi <mchornyi@nvidia.com>
Merge-request: !9054
2023-12-12 08:36:26 -05:00
Randolph M. Fritz
1dbfe638da FindOpenGL: Document how to use macOS X11 OpenGL
Dicourse-topic: https://discourse.cmake.org/t/9466
2023-12-11 10:28:59 -05:00
Randolph M. Fritz
a13f62427b FindOpenGL: Clarify cache entry doc strings on macOS 2023-12-11 10:20:59 -05:00
Brad King
2040b79a39 Merge topic 'compute-compiler-linker'
df025444b2 LinkerId: Identify AIX and SunOS system linkers
c1e48a19a5 LinkerId: Try multiple flags to detect linker id and version
1e42a0cf18 LinkerId: Match linker id and version more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9057
2023-12-09 08:16:01 -05:00
Brad King
ca08b492c3 Merge topic 'csharp-utilities-doc-fix'
cd6771646a CSharpUtilities: Fix cross-reference in documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9055
2023-12-09 08:14:51 -05:00
Brad King
243f56c8e0 Merge topic 'LLVMFlang-Fortran-link-enhancements'
0502b345f2 LLVMFlang Fortran: enhance link capabilities

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9025
2023-12-09 08:14:06 -05:00
Brad King
143f5abb3b Merge topic 'find-rustc-importlibs'
f20c5c6f20 MSVC: Teach find_library to consider Rust's '${name}.dll.lib' convention
7598ea5389 Tests: Add case covering find_library behavior when targeting MSVC ABI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9046
2023-12-09 08:11:56 -05:00
Brad King
df025444b2 LinkerId: Identify AIX and SunOS system linkers
Populate `CMAKE_<LANG>_COMPILER_LINKER_{ID,VERSION}` on these platforms.
2023-12-08 16:32:20 -05:00
Brad King
c1e48a19a5 LinkerId: Try multiple flags to detect linker id and version
In general there is no one flag on any platform that can identify every
linker.
2023-12-08 15:50:11 -05:00
Brad King
1e42a0cf18 LinkerId: Match linker id and version more robustly
Extract version number output only after explicitly matching it.
2023-12-08 15:48:15 -05:00