1081 Commits

Author SHA1 Message Date
Brad King
3873574f89 Help: Update MSVC_VERSION range for VS 17.10's MSVC 14.40 toolset
According to this blog post:

* https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/

the 14.40 through 14.49 version range will be used by the v143 toolsets.

Fixes: #26015
2024-05-29 11:48:08 -04:00
Evan Wilde
3fb4092826 Swift: Add CMAKE_LINKER_TYPE support
Extend commit 96a953b1ed (Add options to specify linker tool, 2023-09-27,
v3.29.0-rc1~577^2) with the `CMAKE_Swift_USING_LINKER_*` variables
needed to support `CMAKE_LINKER_TYPE` for Swift.
2024-04-02 10:42:12 -04:00
Brad King
82d945fcfe Merge topic 'doc-vsfortran' into release-3.29
7fa0057c74 Help: emphasize need for VS Integrations with oneAPI Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9387
2024-04-01 09:33:44 -04:00
scivision
7fa0057c74 Help: emphasize need for VS Integrations with oneAPI Fortran
Be more explicit that VS Integration is required to use
Intel Fortran with MSVC.

It is common that users do not have VS Integration installed because
oneAPI is then only usable with a narrow range of MSVC versions,
even when oneAPI is used by itself with MSVC as the required backend.
Without VS Integration, a wide range of MSVC versions work as the
backend to oneAPI on Windows.
2024-03-29 15:29:59 -04:00
Craig Scott
6ba2bbc0f3 Help: Restructure and improve LINKER_TYPE docs 2024-03-26 08:03:14 +11:00
Craig Scott
c39bc6e412 Help: CMAKE_<LANG>_USING_LINKER_<TYPE> can be a list of flags 2024-03-26 08:03:14 +11:00
Craig Scott
1c7ccefd83 Help: Add custom linker example for CMAKE_<LANG>_USING_LINKER_<TYPE> 2024-03-26 08:03:14 +11:00
Craig Scott
aecea7b28b Help: Grammar, typos and wording improvements for linker variables 2024-03-26 08:03:14 +11:00
Craig Scott
09cf39ab07 Help: Improve wording of CMAKE_PROJECT_..._INCLUDE... changes for 3.29 2024-03-16 17:42:10 +11:00
Brad King
8f0801cacc Merge topic 'LINKER_TYPE-mold-support' into release-3.29
801ae06952 LINKER_TYPE: Support MOLD only on GCC versions that support it
939ac5287e LINKER_TYPE: fix spelling error in message
922883782b LINKER_TYPE: Document that linker tool should be in the PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9334
2024-03-14 11:45:13 -04:00
Brad King
3a739d4dcb EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate
Some design concerns have been raised after trying the 3.29 release
candidates.  Avoid committing to a stable public interface for now.

Issue: #25767
2024-03-12 14:24:53 -04:00
Marc Chevrier
922883782b LINKER_TYPE: Document that linker tool should be in the PATH
Issue: #25748
2024-03-12 09:00:49 -04:00
scivision
53a542936e Help: Convert http URLs to https 2024-03-07 09:42:45 -05:00
Craig Scott
fb14a54a25 Help: Advise calling option(BUILD_SHARED_LIBS) early enough
Amends 01e33df83f (Help: Modernize BUILD_SHARED_LIBS
documentation, 2024-02-21) to highlight that BUILD_SHARED_LIBS
needs to be set early enough to prevent different behavior between
the first and subsequent runs.
2024-02-22 10:33:21 +11:00
Brad King
01e33df83f Help: Modernize BUILD_SHARED_LIBS documentation
Previously the documentation used long-outdated terminology from
CMake's early days.

Issue: #25699
2024-02-21 09:25:49 -05:00
Alan Phipps
9ba0a54554 TIClang: Add support for TI Clang-based compilers, including tiarmclang
Add TIClang compiler ID and support in compiler modules.  Update
documentation.  Add rudimentary RunCMake test for TIClang to test
basic functionality.

Fixes: #24619
2024-02-09 15:54:40 -05:00
Brad King
d968391a0f Merge topic 'doc-autogen' into release-3.29
ccaf529c4e Autogen: Update Documentation
16cc011fa5 cmQtAutoGenGlobalInitializer: Improve Const-correctness

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9223
2024-02-08 11:10:47 -05:00
Orkun Tokdemir
ccaf529c4e Autogen: Update Documentation
* Add Qt 6 to documentation
* Add explanation about `<ORIGIN>_autogen_timestamp_deps`

Fixes: #25201
2024-02-08 09:16:37 -05:00
Peter Kokot
ef2547bd6a Help: Document CMAKE_SYSTEM_NAME possible values
Fixes: #21489
2024-02-05 10:15:08 -05:00
Silvio Traversaro
06af18b9db cmake: Allow CMAKE_INSTALL_PREFIX to be set by environment variable
Fixes: #25023
2024-01-30 11:44:45 -05:00
Brad King
13ece67a58 Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR
Evaluate generator expressions in these properties, as they apply to
`add_test`, `add_custom_command`, and `add_custom_target`.

The `CMAKE_CROSSCOMPILING_EMULATOR` variable's `try_run` behavior occurs
at configure time and so cannot support generator expressions.
2024-01-29 10:30:24 -05:00
Brad King
c75047709f Merge topic 'autogen-exe-per-config'
596e84b0d5 NinjaMultiConfig: Update tests for the new dependency change
7c39dabdbc Autogen: AUTO*_EXECUTABLE: add support for per-config values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8919
2024-01-18 09:01:17 -05:00
Orkun Tokdemir
7c39dabdbc Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`.
* Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to avoid unnecessary rebuilds.
* A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used.
* Add `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG` target property to change the behavior of the dependency graph.
* The timestamp target is split into three targets for per-config to avoid redundant `mocs_compilation` builds when `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`	 is ON
* Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `Multi-Config` usage.
* Some functions were refactored to avoid code duplication.

This commit reimplements fddd0f0443

Fixes: #20074
2024-01-17 16:02:58 +01:00
Brad King
ff0085cf74 Help: Drop incorrect versionadded mark from CMAKE_MATCH_<n>
It was added by commit 496ec6036f (Help: Add Sphinx 'versionadded'
directives to each top-level document, 2020-07-06, v3.19.0-rc1~558^2)
because the document happened to be added during the 3.9 release series,
but the variable has existed since the beginning.
2024-01-09 16:31:53 -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
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