Commit Graph

13893 Commits

Author SHA1 Message Date
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
Jan Blumschein
cd6771646a CSharpUtilities: Fix cross-reference in documentation
The documentation fix commit 04a11f16ba (CSharpUtilities: Fix
documentation, 2017-03-15, v3.8.0-rc3~17^2) introduced a cross-reference
to the function being documented.  Fix it.

Issue: #16711
2023-12-08 15:40:09 -05:00
Marc Chevrier
0502b345f2 LLVMFlang Fortran: enhance link capabilities
* Add support for "LINKER:" prefix.
* Add support, on Linux, for linker selection through CMAKE_LINKER_TYPE variable.
2023-12-08 19:22:24 +01:00
Robert Maynard
f69b9b7305 CUDAToolkit: Restore ability to find cupti headers
Fixes #25484

PR !8835 failed to update the CUPTI header searches to use the
new internal FindCUDAToolkit search variables. This caused the
CUDA::cupti target to always not exist.
2023-12-08 11:46:54 -05:00
Daniel Ching
f20c5c6f20 MSVC: Teach find_library to consider Rust's '${name}.dll.lib' convention
This convention is used by Rust toolchains (rustc/cargo/cargo-c) for the
MSVC ABI.

Fixes: #25478
2023-12-07 19:19:00 -06:00
Brad King
f23636617a CMakePackageConfigHelpers: Move platform selection template to Internal/
The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add
generate_apple_platform_selection_file(), 2023-11-03) is a private
implementation detail.  Move it to `Modules/Internal/`.
2023-12-07 16:54:09 -05:00
Brad King
52d854e93b Merge topic 'FindCUDAToolkit-fix-stubs'
d85bf99bcb FindCUDAToolkit: Fix stub library representation on reconfigure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9045
2023-12-07 10:57:21 -05:00
Brad King
2d60f5c7a6 Merge topic 'FindCUDAToolkit-fix-stubs' into release-3.28
d85bf99bcb FindCUDAToolkit: Fix stub library representation on reconfigure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9045
2023-12-07 10:57:20 -05:00
Brad King
256d532593 Merge topic 'GoogleTest-discovery-scope'
0767016eab GoogleTest: Avoid silent failures of dynamic test discovery

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9038
2023-12-07 09:20:43 -05:00
Brad King
7693a8152d Merge topic 'win-path'
3f2a5971c0 Modules: CMAKE_*_COMPILER convert path to cmake path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9027
2023-12-07 09:18:43 -05:00
Brad King
b2b0d839c1 Merge topic 'LLVMFlang-MSVC'
cd28915260 LLVMFlang: Update MSVC ABI and architecture detection for LLVMFlang 18.0
48302b469e LLVMFlang: Update MSVC runtime library selection for LLVMFlang 18.0
1c07758ca2 CMakeParseImplicitLinkInfo: Exclude LLVMFlang program entry point for MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9036
2023-12-07 09:16:11 -05:00
Brad King
092438e9f6 Merge topic 'doc-fetchcontent-bad-ref'
bd50e8a058 Help: Fix malformed cross-reference in FetchContent docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9047
2023-12-07 09:02:14 -05:00
Craig Scott
bd50e8a058 Help: Fix malformed cross-reference in FetchContent docs 2023-12-07 17:04:25 +11:00
Brad King
d85bf99bcb FindCUDAToolkit: Fix stub library representation on reconfigure
Since commit 0744c02e24 (FindCUDAToolkit: targets pointing to stubs now
use IMPORTED_IMPLIB, 2023-07-24, v3.28.0-rc1~309^2) we recognize CUDA
stub libraries and represent them in a special way.  However, the logic
only works on the first configuration of a build tree when the libraries
are first found.  Once the results are cached, we incorrectly revert to
the non-stub representation.

Fix this by recognizing stub libraries based on their path instead.
2023-12-06 16:10:24 -05:00
Brad King
cd28915260 LLVMFlang: Update MSVC ABI and architecture detection for LLVMFlang 18.0
LLVMFlang 18.0 adds MSVC ABI and architecture macros.  Resolve the
corresponding FIXME left by commit 26bf32cdc6 (LLVMFlang: Add support
for targeting MSVC ABI on Windows, 2023-09-28, v3.28.0-rc1~10^2).

Issue: #24840
2023-12-06 09:42:07 -05:00
Brad King
48302b469e LLVMFlang: Update MSVC runtime library selection for LLVMFlang 18.0
LLVMFlang 18.0 adds MSVC runtime library selection flags and associated
Fortran runtime library variants.  Resolve the corresponding FIXME left
by commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on
Windows, 2023-09-28, v3.28.0-rc1~10^2).

Issue: #24840
2023-12-06 09:42:07 -05:00
Brad King
1c07758ca2 CMakeParseImplicitLinkInfo: Exclude LLVMFlang program entry point for MSVC
As of llvm-project `main` branch commit `86accd4e03` (2023-12-04),
LLVMFlang 18.0.0, when used to drive linking an executable, emits a MSVC
linker flag to use all object files from the `Fortran_main` library.
These object files are meant for use when linking the program entry
point, and so are not implicit link dependencies of Fortran libraries.
2023-12-06 09:42:07 -05:00
Brad King
5b6f7f44fb Merge topic 'LLVMFlang-MSVC-debug'
ef49ed0fe1 LLVMFlang: Fix MSVC ABI debug information format options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9037
2023-12-06 08:50:18 -05:00
Moritz Haase
0767016eab GoogleTest: Avoid silent failures of dynamic test discovery
The internal helper variable '_GOOGLETEST_DISCOVER_TESTS_SCRIPT' can have gone
out-of-scope when 'gtest_discover_tests()' is called, depending on where the
GoogleTest module is actually included. This leads to a silent failure of
dynamic test discovery, since the custom post-build commands actually does
nothing (it basically invokes 'cmake -P ""'). Ctest will then fail to run the
tests, considering them to be 'not built'.

Fix this by determining the path to the GoogleTest module based on
'${CMAKE_ROOT}' instead, which is always available.

A new test case was added to test suite 'RunCMake/GoogleTest' to ensure that
'gtest_discover_tests()' works correctly when invoked in a different variable
scope.

Fixes: #25477
2023-12-06 12:52:18 +01:00
Michael Hirsch
3f2a5971c0 Modules: CMAKE_*_COMPILER convert path to cmake path
Fixes #25456

Before this, CMake configure halted as the slashes were
interpreted as invalid escape characters
2023-12-05 19:08:39 -05:00
Brad King
ef49ed0fe1 LLVMFlang: Fix MSVC ABI debug information format options
In commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on
Windows, 2023-09-28, v3.28.0-rc1~10^2) we incorrectly recorded `-g` as
supporting the `ProgramDatabase` format, but it is actually `Embedded`,
matching Clang.

In order to support easy integration with C and C++ projects that use
the `.pdb` debug formats, pretend LLVMFlang supports them and just don't
actually emit any debug information.

Issue: #24840
2023-12-04 20:30:46 -05:00
Brad King
0e11e24ecd Merge topic 'FindPerl-doc'
aca215fbe0 FindPerl: Fix documentation word order
dc3f264f9d FindPerl: Improve documentation formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9020
2023-12-01 09:07:10 -05:00
Brad King
ce0835beee Merge topic 'adsp-on-linux'
33e6862cbc ADSP: Allow progress with CMAKE_ADSP_ROOT unset
85e25451af ADSP: Add /opt/analog/cces to  _find_adsp_root()'s search space
04d8a39e5c ADSP: Use find_program() to get path to cc21k/ccblkfn
7883178cae ADSP: Use $CMAKE_EXECUTABLE_SUFFIX in COMPILER_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9016
2023-12-01 09:05:55 -05:00
polarbub
aca215fbe0 FindPerl: Fix documentation word order 2023-11-30 13:32:41 -05:00
Josh Channings
33e6862cbc ADSP: Allow progress with CMAKE_ADSP_ROOT unset
This is a behavior change. You can still set ADSP_ROOT/CMAKE_ADSP_ROOT
to hint the find_program() invocations for the CCES binaries, but it is
no longer necessary if they are already in PATH.

The reason is: CMAKE_ADSP_ROOT is only used to find the binaries. If
they are in PATH, there is no need to supply the root path. If they are
not in PATH, you can hint still hint it as before.

The other option would be to use find_path() to get CMAKE_ADSP_ROOT from
the path to one of the bins, but that would be convoluted and pointless.

There are some circumstances where the binaries are available, but the
ADSP install is not. For example, from my own dev environment:

https://github.com/joshchngs/macos-sharc-tools

Here, the `cc21k` et. al. binaries are actually shell scripts which
launch the real binary inside a running VM.
2023-11-30 16:49:03 +00:00
Josh Channings
85e25451af ADSP: Add /opt/analog/cces to _find_adsp_root()'s search space
This is the default install location on Linux.
2023-11-30 16:49:03 +00:00
Josh Channings
04d8a39e5c ADSP: Use find_program() to get path to cc21k/ccblkfn
This still uses CMAKE_ADSP_ROOT as the PATHS argument, so the same
behavior should be retained - but now the Platform will work without
needing to supply the root, if the binaries are already in $PATH.
2023-11-30 16:49:00 +00:00
polarbub
dc3f264f9d FindPerl: Improve documentation formatting
Also modernize some wording.
2023-11-30 11:42:18 -05:00
Brad King
a1dcc36f65 Merge topic 'rpm-quoting'
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:54 -05:00
Josh Channings
7883178cae ADSP: Use $CMAKE_EXECUTABLE_SUFFIX in COMPILER_NAME
The binaries are obviously not .exe-suffixed on Linux
2023-11-29 19:03:40 +00: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: d44114f007
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
Brad King
1a357afcea Merge topic 'fix-install-jar-exports-warning'
c17268ff0b UseJava: Increase maximum policy version in exported files to 3.27
4567c8205a Help/dev: Update UseJava export policy version in post-release development

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9004
2023-11-28 09:47:02 -05:00
Brad King
c40e242be3 Merge topic 'cpack-auto-suffixes'
53991e62da CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing
f2a6d423da CPack/DEB: Append .deb to CPACK_DEBIAN_FILE_NAME if missing
907d4db558 Help: Format allowed CPACK_{DEB,RPM}_FILE_NAME values as definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8880
2023-11-28 09:45:53 -05:00
Alex Neundorf
53991e62da CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing
Previously we issued an error when the `.rpm` suffix is missing.
Instead, append the suffix automatically.  This matches the behavior of
`CPACK_ARCHIVE_FILE_NAME`, to which the archive format suffix is
automatically appended.  With this change, developers can simply do

    set(CPACK_RPM_comp_FILE_NAME "${CPACK_ARCHIVE_comp_FILE_NAME}")
2023-11-27 10:26:37 -05:00
Alex Neundorf
f2a6d423da CPack/DEB: Append .deb to CPACK_DEBIAN_FILE_NAME if missing
Previously we issued an error when the `.deb` or `.ipk` suffix
is missing. Instead, append the suffix `.deb` automatically.
This matches the behavior of `CPACK_ARCHIVE_FILE_NAME`, to
which the archive format suffix is automatically appended.
2023-11-27 10:25:43 -05:00
Gold856
c17268ff0b UseJava: Increase maximum policy version in exported files to 3.27
Extend commit c5f1af1ffe (export: Increase maximum policy version in
exported files to 3.27, 2023-10-03) to cover UseJava too.

Fixes: #22655
2023-11-27 09:39:55 -05:00
Brad King
81e836e0fe Merge topic 'vs-ifx'
43d218d970 VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files
5c77facd78 VS: Fix Intel plugin version detection fallback

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9001
2023-11-27 08:41:55 -05:00
Brad King
43d218d970 VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files
Add a `fortran={ifort,ifx}` field to `CMAKE_GENERATOR_TOOLSET` to
specify which Intel Fortran compiler to use.

Fixes: #25427
2023-11-22 10:22:12 -05:00
Brad King
d0dc8eea2f Merge topic 'gfortran-flags'
4597fee41f GNU: Remove duplicate and unnecessary optimization flags for gfortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8994
2023-11-22 07:24:01 -05:00
Brad King
874b62abb4 Merge topic 'clang-scan-deps-failed-scan'
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:05 -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
Brad King
4597fee41f GNU: Remove duplicate and unnecessary optimization flags for gfortran
Since commit a66004bee0 (Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in
toolchain files, 2016-07-05, v3.7.0-rc1~392^2) we've accidentally been
adding extra optimization flags instead of replacing unwanted flags.

Fixes: #25434
2023-11-21 08:19:15 -05:00
Brad King
15810cfbcd Merge topic 'modules-modern-foreach'
ec2ad53d18 Modules: refactor compiler find to use modern foreach

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8986
2023-11-20 08:15:26 -05:00
Brad King
4c1a6f2e23 Merge topic 'ci-fedora-39'
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39
9283b20659 ci: Suppress CPack/RPM tests pending fix for Fedora 39
18145e8745 ci: Update FindMPI test environment for mpich on Fedora 39
a8be80ccf2 ci: Drop now-unnecessary Clang rules for CXXModules tests
99238b23e9 ci: use Fedora 39 images and environments
57eadec617 ci: update Linux image to Fedora 39
653262162c clang-tidy module: Update to build against LLVM/Clang 17
2cf9a65835 clang-tidy: ignore warnings new in version 17
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8983
2023-11-20 08:10:37 -05:00
Brad King
aea838cf41 Merge topic 'cpack-wix-installscope'
60661f6770 CPack/WiX: Make InstallScope configurable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8954
2023-11-19 11:55:30 -05:00
Brad King
1f7a653e90 Merge topic 'swift-compilation-mode'
0f80101b73 Tests: Update Swift tests to use CMP0157 NEW behavior
c1d787e473 Swift: Add abstraction for compilation mode
c39384f540 Tests: Simplify RunCMake.Swift conditions to enable use of Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8918
2023-11-19 11:47:37 -05:00
Michael Hirsch
ec2ad53d18 Modules: refactor compiler find to use modern foreach 2023-11-18 19:08:00 -05:00
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00