14753 Commits

Author SHA1 Message Date
Brad King
dc646156d0 Merge topic 'cuda-nvcc-system-includes' into release-4.0
d2be863b5e CUDA: Add include paths from nvcc SYSTEM_INCLUDES entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10857
2025-06-06 08:12:47 -04:00
Robert Maynard
d2be863b5e CUDA: Add include paths from nvcc SYSTEM_INCLUDES entry
Upcoming versions of nvcc are adding support for `SYSTEM_INCLUDES`
which contain includes that are implicitly used with `-isystem`
instead of `-I`.

Support of this is needed in CMake as some CUDA Toolkit releases will
start to have a different include directory layout and using only the
output from `INCLUDES` will be insufficient to find all headers.
2025-06-05 10:53:12 -04:00
Brad King
d5bd7cf09f Merge topic 'clang-cuda-archs' into release-4.0
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10848
2025-06-03 07:54:16 -04:00
Andrey Alekseenko
33fb4e1a50 CUDA/Clang: Add archs supported by Clang 21 2025-06-02 18:35:13 +02:00
Andrey Alekseenko
a6aaabbdff CUDA/Clang: Reorder the logic for setting supported archs 2025-06-02 18:34:26 +02:00
Andrey Alekseenko
695af87c6f CUDA/Clang: Fix list of architectures supported by Clang < 20.1
Clang before 20.1 does not recognize sm_100 and newer.  Revise:

* commit b2251e0deb (CUDA/Clang: Update architectures supported by
                     CUDA 12.8, 2025-02-04, v4.0.2~4^2~1^2)
* commit a1b4c30f24 (CUDA: Add CUDA 12.9 new architectures and family
                     syntax, 2025-04-21, v4.0.2~3^2^2)
2025-06-02 10:32:27 -04:00
Brad King
7092720db5 Merge topic 'Python3.14-support' into release-4.0
41a4a32135 FindPython: Avoid implicit link library on Windows
811f00f9ad FindPython: rely on ABIFLAGS on Windows for ABI profile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10800
2025-05-20 10:45:29 -04:00
Marc Chevrier
41a4a32135 FindPython: Avoid implicit link library on Windows
Starting with version 3.14, on Windows, by specifying macro Py_NO_LINK_LIB,
the python library is no longer implicitly specified at the link step.

Fixes: #26756
2025-05-20 09:16:14 -04:00
Marc Chevrier
811f00f9ad FindPython: rely on ABIFLAGS on Windows for ABI profile
Starting with Python 3.14, the config_var ABIFLAGS is now also available
on Windows.
2025-05-20 09:16:14 -04:00
Brad King
0883fac39a Merge topic 'clang-libstdcpp-3.31' into release-3.31
802f261d62 experimental/CXXModules: recycle the UUID
c88f3ea1e4 Clang/CXXImportStd: support `-stdlib=libstdc++`
ba5c9703b1 Experimental: recycle the `import std` UUID
9cad48c6cb gcc: support `import std`
acbada3df6 Tests/RunCMake: handle C++26 support where needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10778
2025-05-14 15:31:47 -04:00
Ben Boeckel
342f4e195f Merge branch 'clang-libstdcpp-3.31' into clang-libstdcpp-3.31-4.0
* clang-libstdcpp-3.31-bp:
  experimental/CXXModules: recycle the UUID
  Clang/CXXImportStd: support `-stdlib=libstdc++`
2025-05-14 20:18:56 +02:00
Ben Boeckel
c88f3ea1e4 Clang/CXXImportStd: support -stdlib=libstdc++
Fedora 42 ships `clang` with `libstdc++` as the default. Detect and
support `import std;` in this configuration.
2025-05-14 20:15:26 +02:00
Ben Boeckel
9cad48c6cb gcc: support import std
(cherry picked from commit a980dab9b1 (gcc: support `import std`,
2024-11-21))
2025-05-14 20:14:44 +02:00
Brad King
4137187805 Merge topic 'cuda-13.0-prep' into release-4.0
b62f3257f2 CUDA/Clang: Update nvcc default architectures with CUDA 13 deprecations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !10671
2025-05-14 08:35:22 -04:00
Robert Maynard
b62f3257f2 CUDA/Clang: Update nvcc default architectures with CUDA 13 deprecations
As outlined in the CUDA 12.9 release notes sm_5X, sm_6X, and sm_70
are being removed in CUDA 13:

> Maxwell, Pascal, and Volta architectures are now feature-complete with
> no further enhancements planned. While CUDA Toolkit 12.x series will
> continue to support building applications for these architectures,
> offline compilation and library support will be removed in the next
> major CUDA Toolkit version release.
2025-05-13 09:40:00 -04:00
Brad King
e49dc061c2 Merge topic 'clang-macos-sdk' into release-4.0
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
2025-05-03 10:02:16 -04:00
Brad King
07df1a2a64 Merge topic 'cuda-12.9' into release-3.31
a1b4c30f24 CUDA: Add CUDA 12.9 new architectures and family syntax
b2251e0deb CUDA/Clang: Update architectures supported by CUDA 12.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10738
2025-05-03 09:58:35 -04:00
Brad King
031593de25 Merge branch 'backport-cuda-12.9' into cuda-12.9 2025-05-02 16:16:06 -04:00
Robert Maynard
a1b4c30f24 CUDA: Add CUDA 12.9 new architectures and family syntax 2025-05-02 15:46:49 -04:00
Robert Maynard
b2251e0deb CUDA/Clang: Update architectures supported by CUDA 12.8 2025-05-02 15:46:06 -04:00
Brad King
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT
In commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to compilers
by default, 2024-11-06, v4.0.0-rc1~511^2) we broke support for using
upstream LLVM/Clang to build for macOS because the compiler has no
default sysroot.  Handle empty `CMAKE_OSX_SYSROOT` with LLVM/Clang by
falling back to the macOS SDK reported by `xcrun --show-sdk-path` .

Fixes: #26863
2025-05-02 13:49:40 -04:00
Brad King
b729a9d319 Merge topic 'automoc-predefs' into release-4.0
ccef69bde4 AUTOMOC: Avoid compiler warnings while computing predefines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10702
2025-04-24 07:45:19 -04:00
Brad King
ccef69bde4 AUTOMOC: Avoid compiler warnings while computing predefines
LLVM/Clang 20, when invoked as `clang++ -E -c ...`, now warns:

    warning: argument unused during compilation: '-c'

Drop the unnecessary `-c` flag.  Also add a `-w` flag to suppress
warnings so their text is not parsed as predefines.
2025-04-24 07:07:00 -04:00
Brad King
8dee757664 Merge topic 'clang-cuda-default-arch' into release-4.0
47ddbc9ded CUDA/Clang: Prefer NVCC's default architecture for each CUDA Toolkit version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !10698
2025-04-23 08:57:06 -04:00
Brad King
47ddbc9ded CUDA/Clang: Prefer NVCC's default architecture for each CUDA Toolkit version
This makes the default CUDA architecture consistent across compilers,
and makes it more likely that the resulting binary will run on the
user's hardware.

This also makes hardware requirements for CI builds more consistent.
See commit 4f2178c4a8 (ci: add tags to tie CUDA jobs to runners with
hardware supporting them, 2025-04-21).
2025-04-22 09:51:02 -04:00
Brad King
49ca63f3b1 Merge topic 'clang-msvc-c++26' into release-4.0
338f88a809 Clang: MSVC C++26 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10685
2025-04-22 09:17:11 -04:00
Raul Tambre
338f88a809 Clang: MSVC C++26 support
C++26 is implied by `/std:c++latest` since LLVM 17, commit `b763d6a4ed`.
2025-04-21 12:22:29 -04:00
Marc Chevrier
554ef95470 FindPython: fix the definition of SABI artifacts
Fixes: #26881
2025-04-21 16:14:51 +02:00
Brad King
6e63080d39 macOS: Restore RPATH entry for libraries linked from /usr/local/lib
Since commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to
compilers by default, 2024-11-06, v4.0.0-rc1~511^2) our default
invocation of compilers targeting macOS no longer passes `-isysroot`.
Without that, Xcode's compilers search `-L/usr/local/lib` by default
even though the macOS dynamic loader does not.  Since `/usr/local/lib`
is not a fully-implemented implicit link directory, exclude it from our
detected `CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES` so that our generators
do not suppress `RPATH` entries for dependencies in that directory.

Fixes: #26867
2025-04-15 14:13:45 -04:00
Brad King
430174e65d CMakeDetermineCompilerABI: Comment implicit link directory exclusion 2025-04-15 14:13:45 -04:00
Brad King
2e59cee922 FindXCTest: Fix test module generation for Xcode 16
In Xcode 7.3 and above, the `TEST_HOST` setting causes Xcode to
implicitly place the test module inside the executable bundle regardless
of the module's own location settings.  Since commit a364d2513a (Xcode:
Fixup XCTest bundle location for Xcode 7.3, 2016-03-25, v3.5.2~6^2) we
explicitly tell CMake to put the test module in the same location so
that generator expressions used by `xctest_add_test` agree with where
Xcode actually puts it.  In Xcode 16 and above, our explicit location
settings for the test module conflict with Xcode's `TEST_HOST` rules,
causing errors about multiple commands producing the same path.

Fix this by dropping CMake's explicit location for the test module
unless needed to match a project-specified location for the testee.
Instead, teach `xctest_add_test` to express the xctest module location
selected by `TEST_HOST` by using generator expressions referencing the
testee bundle.

Fixes: #26301
Fixes: #26514
2025-04-09 17:06:13 -04:00
Brad King
c653c1aa47 FindXCTest: Pass -bundle_loader linker flag for test module more reliably 2025-04-02 09:31:11 -04:00
Brad King
f2a3a84834 Merge topic 'FindCUDAToolkit-cupti' into release-4.0
cbb8f30ee6 CUDAToolkit: Restore ability to find cupti library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !10533
2025-03-27 09:10:30 -04:00
Brad King
d5d7175d9c Merge topic 'FindCUDAToolkit-cupti' into release-3.31
cbb8f30ee6 CUDAToolkit: Restore ability to find cupti library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10533
2025-03-27 09:09:47 -04:00
Marcus D. Hanwell
cbb8f30ee6 CUDAToolkit: Restore ability to find cupti library
In commit f69b9b7305 (CUDAToolkit: Restore ability to find cupti
headers, 2023-12-08, v3.28.1~8^2) we did not update the CUPTI library
searches to add the extra search path needed for certain install layouts
(only the header search path). Add the additional library search paths.

Fixes: #26770
Issue: #25484
2025-03-26 14:03:34 -04:00
Peter Kokot
dfa2b58cb6 FindQt4: Restore QT4_FOUND setting
Commit 1a8e43d57d (FindPackageHandleStandardArgs: Clarify the FOUND_VAR
option, 2024-12-31, v4.0.0-rc1~247^2) simplified the
`<PackageName>_FOUND` and `<PACKAGENAME>_FOUND` variables one step
further but missed that this specific module sets the `QT4_FOUND`
variable also for the case where `find_package_handle_standard_args()`
isn't called (for example, when the found package is Qt3 or Qt5 and
later).  Restore the `set()` call in case `QT4_FOUND` is used in the
code.
2025-03-21 08:36:57 -04:00
Brad King
8214004200 Merge topic 'GNU-linker-pushpop_state-detection' into release-4.0
d5be7c7f31 Linker: Detect GNU push-state/pop-state flags more robustly
7b552b9a64 Linker: Save GNU push-/pop-state detection with compiler inspection results
a9b126b0da Linker: Save linker inspection results with compiler inspection results
3f5f2b2d49 Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10468
2025-03-21 08:07:13 -04:00
Marc Chevrier
d5be7c7f31 Linker: Detect GNU push-state/pop-state flags more robustly
Try actually passing them to the linker to see whether it complains.

Fixes: #26766
2025-03-20 11:00:02 -04:00
Marc Chevrier
7b552b9a64 Linker: Save GNU push-/pop-state detection with compiler inspection results
Previously we saved it in the cache, which:

* Persists even if a new version of CMake changes how the check works.
* Does not propagate to `try_compile` checks.
2025-03-20 11:00:02 -04:00
Marc Chevrier
a9b126b0da Linker: Save linker inspection results with compiler inspection results
Reconfigure `CMake<LANG>Compiler.cmake` again after linker information
is detected.
2025-03-20 11:00:02 -04:00
Aditya Vidyadhar Kamath
e9c772404b AIX: Consider tbss symbols in ExportImportList
Export `tbss` (thread variable but part of `bss` section) variables, e.g.:

    [125]  m  0x00000010    .tbss    1 extern                   s2n_errno
    [126]  a4 0x00000004      0   0    CM      UL   -   -
2025-03-18 09:56:26 -04:00
Brad King
4223b2410f Merge topic 'ASM_MARMASM-config' into release-4.0
9b5915c178 MARMASM: Fix loading linker information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10487
2025-03-18 09:18:47 -04:00
Brad King
52b62cf4e1 Merge topic 'ASM_MARMASM-config' into release-3.31
9b5915c178 MARMASM: Fix loading linker information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10487
2025-03-18 09:16:34 -04:00
Marc Chevrier
9b5915c178 MARMASM: Fix loading linker information
Fix misspelled `ASM_DIALECT` variable value.
2025-03-17 12:02:38 -04:00
Brad King
89f6be8264 Merge topic 'msvc-c++23' into release-4.0
d54916d03a MSVC: Revert use of temporary -std:c++23preview flag for C++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10470
2025-03-17 11:42:03 -04:00
Brad King
d54916d03a MSVC: Revert use of temporary -std:c++23preview flag for C++23
Revert commit b3f1c60aff (MSVC: Use -std:c++23preview flag for C++23
when available, 2025-03-12), except for the VS flag table update.
MSVC documentation states that the flag will be removed in the future
when `-std:c++23` is added.  Therefore it is only suitable for manual
specification by end-users.

Issue: #26692
2025-03-14 09:55:18 -04:00
Brad King
5cfb301524 Merge topic 'msvc-c++23' into release-4.0
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
1b4a802413 MSVC: Split C++23 flag selection into dedicated block

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10462
2025-03-13 09:40:53 -04:00
Brad King
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
This was added by VS 17.13.

Fixes: #26692
2025-03-12 14:50:32 -04:00
Brad King
1b4a802413 MSVC: Split C++23 flag selection into dedicated block 2025-03-12 14:50:31 -04:00
Marc Chevrier
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection
Fixes: #26747
2025-03-10 10:36:27 -04:00