Commit Graph

11138 Commits

Author SHA1 Message Date
Marc Chevrier
8ac63eb4b8 Merge topic 'FPHSA-usable-outside-find_package'
14ecf9c2f6 FPHSA: ensure it can be used outside 'find_package'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5539
2020-11-28 09:02:54 -05:00
Marc Chevrier
14ecf9c2f6 FPHSA: ensure it can be used outside 'find_package'
Fixes: #21505
2020-11-25 16:36:12 +01:00
Brad King
0e28b39f41 Merge topic 'cuda_detect_vs_codegen'
20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5531
2020-11-25 08:35:08 -05:00
Raul Tambre
20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio
If the user specifies CMAKE_CUDA_ARCHITECTURES we use those during detection
and error out if they don't work.
For Visual Studio a dummy project file is used instead of invoking the compiler
directly. NVCC would thus use its default and we'd fail if
CMAKE_CUDA_ARCHITECTURES was anything other than NVCC's default.

Use the necessary project file variable in CMakeDetermineCompilerId.cmake to
match other generators.

Fixes #21492.
2020-11-25 08:27:40 -05:00
Brad King
8832b695e0 Merge topic 'cuda_11'
046e454fdd CUDA: Error if can't determine toolkit library root
440dc98b07 CUDA: Clang CUDA 11.1 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5525
2020-11-23 11:23:02 -05:00
Raul Tambre
046e454fdd CUDA: Error if can't determine toolkit library root
Finding the toolkit is required for Clang and is assumed to have been correctly
found by FindCUDAToolkit if the CUDA language is found.
Error out early with an useful error instead of failing later on due to the
path not being set.
2020-11-22 11:30:01 +02:00
Raul Tambre
440dc98b07 CUDA: Clang CUDA 11.1 support
version.txt is gone from CUDA 11.1 installations, but the rest is the same.
Instead of looking for version.txt look for <CUDA path>/nvvm/libdevice, which
is the main thing that Clang requires (though it also checks for the existence
of bin and include).

Fixes #21353.
2020-11-22 11:30:01 +02:00
Brad King
3bc549540e Merge branch 'master' into FindGTest-revert-no-release 2020-11-20 10:15:53 -05:00
Brad King
60a131efd5 Merge topic 'revert-explicit-LANGUAGE-flag'
30aa715fac Revert "specify language flag when source LANGUAGE property is set"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5519
2020-11-20 10:05:11 -05:00
Brad King
64dc4efc51 FindGTest: Revert "Allow either "Debug" or "Release" configurations."
Revert commit a064b18f85 (FindGTest: Allow either "Debug" or "Release"
configurations., 2020-06-29, v3.19.0-rc1~584^2).  If both configurations
are found then `GTEST_LIBRARY` is populated in a way that breaks
`__gtest_determine_library_type`, and the imported target is not
created correctly.

Fixes: #21473
Issue: #17799
2020-11-20 09:31:54 -05:00
Brad King
30aa715fac Revert "specify language flag when source LANGUAGE property is set"
Revert commit 74b1c9fc8e (Explicitly specify language flag when source
LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup
tables from its two immediate ancestors.  The purpose of that change was
to convert an explicit `LANGUAGE` source file property into an explicit
language specification compiler flag like `-x c`.  This seems reasonable
since the property is documented as meaning "indicate what programming
language the source file is".  It is also needed to help compilers deal
with non-standard source file extensions they don't recognize.

However, some projects have been setting `LANGUAGE C` on `.S` assembler
source files to mean "use the C compiler".  Passing `-x c` for them
breaks the build because the `.S` sources are not written in C.  These
projects should be updated to use `enable_language(ASM)`, for which
CMake often chooses the C compiler as the assembler when using
toolchains that support it (which would have to be the case for projects
using the approach).

Revert the change for now to preserve the old behavior for such projects.
We can re-introduce it with a policy in a future version of CMake.

Fixes: #21469
Issue: #14516, #20716
2020-11-19 17:06:03 -05:00
Brad King
c8b2331e8b Merge topic 'rename_cuda_memcheck'
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5514
2020-11-18 07:29:54 -05:00
Tobias Ribizel
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Andrew Fuller
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none
Fixes: #21356
2020-11-16 14:03:07 -05:00
Brad King
c00a6d3967 MSVC: Do not add /GR to CMAKE_CXX_FLAGS by default
The `/GR` flag has been on by default since MSVC cl 14.0 from VS 2005.
Remove it from the default flags to make it easier for projects to pass
`/GR-` themselves to turn it off.

Projects may be using string processing to replace `/GR` with another
flag, so we cannot simply drop it.  Add a policy to drop it in a
compatible way.

Fixes: #21428
2020-11-13 11:46:23 -05:00
Brad King
6114c8e994 MSVC: Factor out initialization of /GR flag 2020-11-13 10:50:25 -05:00
Brad King
225fb10f67 Merge topic 'usejava_helpers'
cb28d9af1f UseJava: Move helper scripts to subdirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5501
2020-11-13 09:48:56 -05:00
Brad King
1bedfa7c5d Merge topic 'android-abis'
3a2bb717ee Android: load ABI information from abis.cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5499
2020-11-13 09:46:40 -05:00
Brad King
c457670711 Merge topic 'qtifw-archivegen'
5ab75dd7dd CPack/IFW: Locate the archivegen utility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5503
2020-11-13 09:45:33 -05:00
Brad King
c35c4ae85c Merge topic 'qtifw-archivegen' into release-3.19
5ab75dd7dd CPack/IFW: Locate the archivegen utility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5503
2020-11-13 09:45:32 -05:00
Brad King
5dd1d841f3 Merge topic 'qtifw-4.0'
63ae96a317 CPack/IFW: Add support for QtIFW 4.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5502
2020-11-13 09:44:28 -05:00
Brad King
140e06e344 Merge topic 'qtifw-4.0' into release-3.19
63ae96a317 CPack/IFW: Add support for QtIFW 4.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5502
2020-11-13 09:44:27 -05:00
Brad King
d8b50fd185 Merge topic 'xcode-compiler-id-path' into release-3.19
bcbae3f71e Xcode: Extract CMAKE_<LANG>_COMPILER from compiler id with multiple archs
a070565a66 Merge branch 'FindRuby-restore-VENDORLIB_DIR' into release-3.18
3969c86b51 Merge branch 'cuda_vs_skip_computation' into release-3.18

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5506
2020-11-13 09:41:25 -05:00
Brad King
72f8237422 Merge topic 'xcode-compiler-id-path'
bcbae3f71e Xcode: Extract CMAKE_<LANG>_COMPILER from compiler id with multiple archs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5506
2020-11-13 09:41:25 -05:00
Brad King
5ba7559966 Merge topic 'xcode-compiler-id-arch'
98849039cc Xcode: Default to arm64 arch on Apple Silicon hosts during compiler id

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5505
2020-11-13 09:40:09 -05:00
Erlend Egeberg Aasland
5ab75dd7dd CPack/IFW: Locate the archivegen utility
Fixes: #21427
2020-11-12 21:22:53 +01:00
Brad King
bcbae3f71e Xcode: Extract CMAKE_<LANG>_COMPILER from compiler id with multiple archs
When targeting a platform that supports multiple architectures, Xcode
may choose to build all of them in our small compiler id project.
Update the regex we use to extract the path to the compiler from
the Xcode output to account for this.

Fixes: #21425
2020-11-12 12:20:34 -05:00
Brad King
98849039cc Xcode: Default to arm64 arch on Apple Silicon hosts during compiler id
In commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we forgot to update the
compiler id architecture selection added by commit 26673bf480 (Xcode:
Explicitly specify default native architecture on macOS, 2020-07-16,
v3.18.1~20^2).

Issue: #21425
2020-11-12 11:26:19 -05:00
Nikita Nemkin
cb28d9af1f UseJava: Move helper scripts to subdirectory
Also, exclude them from the help module index.
2020-11-12 20:14:05 +05:00
Erlend Egeberg Aasland
63ae96a317 CPack/IFW: Add support for QtIFW 4.0
installerbase v4.0 segfaults on macOS if you pass `--framework-version`,
so re-order flags to try `--version` first.

Fixes: #21426
2020-11-12 09:53:51 -05:00
Brad King
8be538b092 Merge topic 'ctest-batch'
aa754e2913 CTest: Remove additional batch test variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5494
2020-11-12 09:14:39 -05:00
Brad King
08b0668043 Merge topic 'FindBLAS/OpenBLAS-OpenMP'
f7f3d8987a FindBLAS: Add dependency of OpenBLAS on OpenMP for BLA_STATIC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5487
2020-11-12 09:12:56 -05:00
Brad King
d8aaa06b54 Merge topic 'FindRuby-vs-runtimes' into release-3.19
d4a16427e2 FindRuby: Consider more VS runtime suffix combinations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5486
2020-11-12 09:09:52 -05:00
Brad King
10c46689ec Merge topic 'FindRuby-vs-runtimes'
d4a16427e2 FindRuby: Consider more VS runtime suffix combinations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5486
2020-11-12 09:09:52 -05:00
Haibo Huang
3a2bb717ee Android: load ABI information from abis.cmake
They are added to NDK and planned to release in r23:
https://android-review.googlesource.com/c/platform/ndk/+/1493421
2020-11-11 17:11:45 -08:00
Brad King
fd8eef0341 Merge topic 'FortranCInterface-CMP0056'
15e77fbd40 FortranCInterface: Honor CMAKE_EXE_LINKER_FLAGS under CMP0056

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5483
2020-11-11 09:41:10 -05:00
Brad King
6f61b59e74 Merge topic 'android-abi' into release-3.19
a585b75df9 Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABIS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5488
2020-11-11 09:33:02 -05:00
Brad King
566ad7c61e Merge topic 'android-abi'
a585b75df9 Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABIS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5488
2020-11-11 09:33:02 -05:00
Seth R Johnson
aa754e2913 CTest: Remove additional batch test variables
Follow up commit f984296ba8 (CTest: Remove unfinished batch test mode,
2017-12-08, v3.11.0-rc1~217^2).
2020-11-11 09:12:14 -05:00
Eisuke Kawashima
f7f3d8987a FindBLAS: Add dependency of OpenBLAS on OpenMP for BLA_STATIC
Fixes: #16221
2020-11-11 09:10:22 -05:00
Silvio Traversaro
d4a16427e2 FindRuby: Consider more VS runtime suffix combinations
These are needed to find recent Ruby versions for builds using
recent VS versions.

Fixes: #21066
2020-11-11 08:30:42 -05:00
Haibo Huang
a585b75df9 Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABIS
Revise logic from commit 1ab574a0f4 (Android: Add support for NDK r22,
2020-10-07, v3.19.0-rc1~18^2) that loads ABI tables from the NDK.

`NDK_DEFAULT_ABIS` means the abis to build by default.
Use `NDK_KNOWN_DEVICE_ABI{32,64}S` instead.

In practise they have never been different. Fix to make it more precise.
2020-11-10 11:05:36 -08:00
Brad King
f4f3fca99f Merge topic 'android-root'
cbc51a8be3 Android: restructure android search paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: huangqinjin <huangqinjin@gmail.com>
Merge-request: !5479
2020-11-10 09:42:31 -05:00
Brad King
781114e792 Merge topic 'python3.10'
bb2ebbf241 FindPython{Interp,Libs}: Add support for version 3.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5482
2020-11-10 09:40:54 -05:00
Brad King
15e77fbd40 FortranCInterface: Honor CMAKE_EXE_LINKER_FLAGS under CMP0056
Policy CMP0056 determines whether `CMAKE_EXE_LINKER_FLAGS` are passed
into the test project used by the source-file signature of `try_compile`.
That affects how implicit link directories are detected, so we need to
also honor the policy for the source-directory signature of `try_compile`
used in FortranCInterface in order to get matching link directories.

Fixes: #21408
2020-11-10 09:33:27 -05:00
Miro Hrončok
bb2ebbf241 FindPython{Interp,Libs}: Add support for version 3.10
Extend the change from commit 23cd98a66a (FindPython: Add support of
version 3.10, 2020-10-16, v3.19.0-rc2~25^2) to cover the legacy
`FindPython{Interp,Libs}` modules too.
2020-11-09 11:44:13 -05:00
Haibo Huang
cbc51a8be3 Android: restructure android search paths
1. Set CMAKE_FIND_ROOT_PATH unconditionally.

Revise the implementation from commit a7f41a7ee4 (Android: Fix find_*
search order within NDK for unified toolchains, 2020-10-13).  In the old
implementation, if people set CMAKE_FIND_ROOT_PATH, CMAKE_ANDROID_NDK
won't be added to find root. And all paths added to CMAKE_SYSTEM_*_PATH
below will be rerooted to the user specified root.

2. Add api level specific library path to CMAKE_SYSTEM_PREFIX_PATH.

As the discussion in [1], some people want the paths added by
UnixPaths.cmake. They install their libraries according to
GNUInstallDirs [2].

As a result, we cannot clear CMAKE_SYSTEM_PREFIX_PATH. It includes /usr
so no matter what we specify in CMAKE_SYSTEM_LIBRARY_PATH,
/usr/lib/<arch> will be searched first.

The author also pointed out a way to solve this issue [3]. In addition
to other paths, CMake also searches <root>/<prefix> [4]. So we can add
the API specific lib path to the beginning of CMAKE_SYSTEM_PREFIX_PATH,
to have it searched first.

[1] https://android-review.googlesource.com/c/platform/ndk/+/1486800
[2] https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
[3] https://github.com/android/ndk/issues/1179#issuecomment-613435081
[4] 11425041f0/Source/cmSearchPath.cxx (L202)
2020-11-09 08:15:46 -05:00
Brad King
63a1917d09 Merge topic 'FindProtobuf-multiple-extensions'
2bb3c0a44b FindProtobuf: Support files with multiple extensions (#18329)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5476
2020-11-09 08:03:39 -05:00
Brad King
b1bc99d34a Merge topic 'TestBigEndian-use-abi-result'
fcc89bda1d TestBigEndian: Re-implement using byte order detected from ABI check
412ce907a2 Tests: Prepare RunCMake.ABI cases to run more checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5477
2020-11-09 08:01:37 -05:00
Brad King
d0391599a8 Merge topic 'android-flags'
94d87afece Android: allow NDK to control cflags / ldflags
85e5139aba Android: Move *_LLVM_TRIPLE to the centralized table

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5461
2020-11-09 07:58:49 -05:00