Commit Graph

1057 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
Evan Wilde
c1d787e473 Swift: Add abstraction for compilation mode
Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding
`Swift_COMPILATION_MODE` target property to control the compilation
mode.  Select among `wholemodule`, `singlefile`, and `incremental`.

Add policy CMP0157 to remove the default `-wmo` flags in favor of the
abstract setting.

Issue: #25366
2023-11-17 08:43:21 -05:00
Brad King
6f8532fbfa Merge topic 'autogen-rsp'
232610e60e Autogen: Use new API for limiting autogen command line lengths
7a07887055 Autogen: Add support for response files for moc predef targets
7eb5ab2c63 Autogen: Generalize MaybeWriteMocResponseFile to MaybeWriteResponseFile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8944
2023-11-17 08:23:18 -05:00
tophoo
7a07887055 Autogen: Add support for response files for moc predef targets
Add support for response files for moc predef targets and make the limit when
to use response files for autogen targets configurable.
2023-11-16 16:29:02 +01:00
Brad King
105ac2670b Merge topic 'doc-find_package-advice'
d007d304ff Help: FetchContent FIND_PACKAGE_ARGS REQUIRED usually inappropriate
6341267780 Help: Note ways CMAKE_..._FIND_PACKAGE_... vars can break projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8951
2023-11-15 08:38:54 -05:00
Kyle Edwards
c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00
William Sciaroni
5e0c1777a3 Optionally make test target depend on all
Fixes: #8774
2023-11-10 13:19:11 -05:00
Craig Scott
6341267780 Help: Note ways CMAKE_..._FIND_PACKAGE_... vars can break projects
Issue: #23779
2023-11-07 21:38:10 +08:00
Marc Chevrier
c26c6ac488 Link Step: compute effective linker used by the compiler
Extract the effective linker during the computation of implicit artifacts
delivered by the compiler to the linker.
Define various variables describing the linker:
* CMAKE_<LANG>_COMPILER_LINKER
* CMAKE_<LANG>_COMPILER_LINKER_VERSION
* CMAKE_<LANG>_COMPILER_LINKER_ID
* CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT

This is complementary to feature introduced by commit 96a953b1ed
(Add options to specify linker tool, 2023-09-27).

Fixes: #17596, #18209, #25344
2023-10-24 08:34:50 -04:00
Cristian Le
b37b912e8f CMAKE_PROJECT_INCLUDE: Allow to run module files
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-18 18:01:05 +02:00
Cristian Le
704acca96b CMAKE_PROJECT_INCLUDE: Add support for including multiple files
Fixes: #25341
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-18 13:39:55 +02:00
Marc Chevrier
96a953b1ed Add options to specify linker tool
Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as
the target property `LINKER_TYPE` to specify which linker must be used.

The implementation of this capability is specified by variables specific
to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`.
Some definitions are provided as part of `CMake`.

For example, to select the `LLVM` linker rather than the standard one,
the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`.
And, on `Apple`, `Linux` and some environments on `Windows`, the variable
`CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows`
environments  based on `MSVC`, where the linker is used directly, the tool
`lld-link.exe` will be used rather than `link.exe`.

Fixes: #19174, #24254, #24990
2023-10-13 11:52:35 +02:00
Ben Boeckel
0c07f39006 cmExperimental: remove the flag for C++ modules
All the major compilers now have scheduled releases with support for
scanning, so remove the experimental gate.

Fixes: #18355
2023-10-02 10:17:31 -04:00
Brad King
2a12a83037 Merge topic 'misc-cxxmodule-fixes'
3b632f32fa Tests/CXXModules: forward the default build type
5ab6b09691 Tests/CXXModules: fix multi-config and MSVC details
11b62ef118 Tests/CXXModules: add missing `bmi-only` and compiler id fields
5d9631fbdd Tests/CXXModules: fix key set mismatch error messages
86e7fb72cb Tests/CXXModules: use a less generic name for the config
6b940dc590 Tests/CXXModules: replace the object extension as well
1c9f83c8ec Tests/CXXModules: fix error detection propagation
7a4c02cb38 cmGlobalGenerator: factor out messaging for CMP0037
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8834
2023-09-27 11:22:05 -04:00
Brad King
5d32320bf3 Merge topic 'hip-nvidia'
fd982eec10 HIP: Add tests for special NVIDIA values of CMAKE_HIP_ARCHITECTURES
8c8b3f1bfa HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC
b3e92775ab HIP: Add CMAKE_HIP_HOST_COMPILER when compiler is NVCC
e43918b4ca HIP: Fix linking mixed-lang binary with CXX compiler and Makefile generators
4794505122 HIP: Do not require hip-lang package for NVIDIA platform
09d759dc7f HIP: Simplify exclusion of AMD device runtime with NVIDIA GPUs
2a60663670 HIP: Simplify CMAKE_GENERATOR references for determining compiler
8124950f6c CUDA: Generalize CMAKE_{CUDA => <LANG>}_HOST_COMPILER variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8836
2023-09-26 09:40:25 -04:00
Ben Boeckel
43112cbb45 Help/CMAKE_EXPORT_COMPILE_COMMANDS: mention the output field
Added in 887a8874c3 (EXPORT_COMPILE_COMMANDS: add `output` field,
2022-10-28) via !7844. Sync the docs with this addition.
2023-09-25 17:39:35 -04:00
Brad King
b3e92775ab HIP: Add CMAKE_HIP_HOST_COMPILER when compiler is NVCC
Also add `HIPHOSTCXX` environment variable.
2023-09-25 16:11:18 -04:00
Brad King
8124950f6c CUDA: Generalize CMAKE_{CUDA => <LANG>}_HOST_COMPILER variable docs 2023-09-25 16:06:30 -04:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Ryan Krattiger
80838316a8 CrayClang: Add support for this compiler
Add `CrayClang` compiler ID for newer Cray compilers.

Fixes: #25102
2023-09-22 09:39:52 -04:00
Brad King
122ec98dcf Merge topic 'hip-nvidia'
6546aa2a2a ci: Add HIP job using CUDA on NVIDIA GPUs
18158bf81c HIP: Add support for NVIDIA GPUs
127b6fa06b HIP: Add CMAKE_HIP_PLATFORM variable to specify GPU platform
90e23f40ee Tests/HIP/WithDefs: Clean up test case
9ebdf3281f Tests/HIP/ArchitectureOff: Cover HIP_ARCHITECTURES initialization
cfec29196e ci: Add CUDA 11.8 to HIP 5.5 image
26470eb987 ci: Put HIP GPU platform in CMake_TEST_HIP

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8817
2023-09-22 09:19:52 -04:00
Brad King
18158bf81c HIP: Add support for NVIDIA GPUs
Add support for using the CUDA Toolkit's NVCC to compile HIP code.

Fixes: #25143
2023-09-21 15:34:37 -04:00
Brad King
127b6fa06b HIP: Add CMAKE_HIP_PLATFORM variable to specify GPU platform
For now, require the value to be `amd`, since that is the only
platform we currently support.
2023-09-21 15:34:37 -04:00
Brad King
51c2927816 Help: Clarify requirements for find_package to use lib{64,32,x32} paths
Issue: #25157
2023-09-20 12:44:00 -04:00
Brad King
5e5132e1b1 MinGW: Search for packages in standard MSYSTEM environment prefixes
MSYS2 and similar MinGW/MSYS distributions define development
environments with a `MSYSTEM` environment variable.  Each such
environment has a documented installation prefix for its packages,
often provided by a `MSYSTEM_PREFIX` environment variable.
Since commit 84a25fc263 (cmake_host_system_information: Add
MSYSTEM_PREFIX query, 2023-09-08) we can look up this prefix.

Add `$MSYSTEM_PREFIX/local` and `$MSYSTEM_PREFIX` to our system search
prefixes when targeting MinGW under `MSYSTEM` environments.  This is
their equivalent to `/usr/local` and `/usr`, which we search by default
on UNIX systems.

Issue: #24216
2023-09-13 08:35:59 -04:00
Gregor Jasny
b78a14e204 Xcode: reject legacy buildsystem for Xcode 14
With Xcode 14 support for the Legacy Build System has been removed
and the BuildSystemType in the WorkspaceSettings is ignored.
If CMake still generates projects targeted to the Lecacy Build
System the build preparation phase will likely fail because Xcode
for example misses any declared outputs from script invocations.

This is a hard to debug problem and CMake should reject the invalid
configuration instead.
2023-08-31 10:13:57 +02:00
scivision
a8634b878a Help:ENV: note escaping needed for special characters 2023-08-17 10:51:14 -04:00
Brad King
d5118ed2e5 Merge branch 'backport-vs-sdk-selection' into vs-sdk-selection 2023-08-10 10:00:53 -04:00
Brad King
ae97d82e83 VS: Teach CMAKE_GENERATOR_PLATFORM to support Windows 8.1 SDK selection
Honor an explicit `version=8.1` field value regardless of the Windows
target version.

Issue: #25170
2023-08-10 09:57:00 -04:00
Brad King
15ff89654b VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
Honor an explicit `version=` field selecting a Windows 10 SDK regardless
of the Windows target version.

Issue: #25170
2023-08-10 09:34:50 -04:00
Craig Scott
feca1d51ff Merge topic 'doc-fixups-release-3.27'
78e7ea598d cmLocalGenerator: Fix trivial spelling error in code comment
1285fe27ff Help: Improve formatting and fix wording for ENABLE_EXPORTS
91336d061c Help: Improve formatting and cross-references for DEPENDS_EXPLICIT_ONLY
03208d9e18 Help: Fix indenting within TARGET_RUNTIME_DLLS genex docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8688
2023-08-07 18:10:56 -04:00
Craig Scott
1285fe27ff Help: Improve formatting and fix wording for ENABLE_EXPORTS 2023-08-06 18:22:51 +10:00
Craig Scott
91336d061c Help: Improve formatting and cross-references for DEPENDS_EXPLICIT_ONLY 2023-08-04 19:16:28 +10:00
Brad King
be03265fa0 Help: Explicitly note that projects should not set CMAKE_CUDA_HOST_COMPILER
Issue: #25093
2023-07-31 10:46:00 -04:00
Márton Marczell
7d3eede923 Help: Document IOS_INSTALL_COMBINED as deprecated
The approach has not made sense since the introduction of Apple Silicon
and macOS arm64.

Issue: #24957
2023-07-20 11:21:24 -04:00
Gregor Jasny
25977e177b apple: add preliminary visionOS support 2023-07-11 20:20:25 +02:00
Brad King
7af90b7bf7 Merge topic 'link-depends-is-OFF'
5945a98ced link dependencies: deactivate the feature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8587
2023-06-26 09:43:56 -04:00
Marc Chevrier
5945a98ced link dependencies: deactivate the feature
Unfortunately it breaks in combination with LTO due to a bug in the GNU
linker.

Fixes: #25014
2023-06-23 10:35:04 -04:00
Brad King
ed37038a1c Merge topic 'cross-compiling-emulator-env-var'
7005dea005 CrossCompiling: Load CMAKE_CROSSCOMPILING_EMULATOR from environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8543
2023-06-14 09:18:45 -04:00