Commit Graph

761 Commits

Author SHA1 Message Date
Yuichiro Utsumi
3a0effcd16 FujitsuClang: Set CMAKE_<LANG>_COMPILER_AR and CMAKE_<LANG>_COMPILER_RANLIB
Fixes: #22337
2021-06-29 09:31:53 -04:00
Paul Zehner
96e362fdc9 Fujitsu: Add IPO support for Fortran 2021-06-24 09:02:15 -04:00
Brad King
b642022046 AppleClang: Add flags for C17 and C23
Follow up commit 72f4984cdc (Clang: C23 support, 2021-02-07).
2021-06-16 15:50:55 -04:00
Gregor Jasny
e8dc95ae1e ObjectiveC: Add C17 and C23 support
Issue: #22297
2021-06-11 14:47:23 +02:00
Robert Maynard
947dbed0aa HIP: Automatically inject the hip::device runtime target
Any target that might need to link to hip code needs the `hip::device`
target
2021-06-07 19:25:33 +00:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Robert Maynard
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake 2021-06-07 19:25:28 +00:00
Brad King
b25225bb61 Merge topic 'msvc_cxx20_23'
886e27062b Clang/MSVC: C++20 final flag, C++23 support
3aaf1d91bf MSVC: C++20 final flag, C++23 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6174
2021-06-02 07:32:30 -04:00
Raul Tambre
886e27062b Clang/MSVC: C++20 final flag, C++23 support
Added in LLVM commit a8f75d497daa2684a03909d7c31d5bce11b427e1, will be released
in 13.0.
2021-05-29 19:44:10 +03:00
Brad King
f530b3a267 OpenWatcom: Add infrastructure to link to object files 2021-05-29 09:28:36 -04:00
Raul Tambre
3aaf1d91bf MSVC: C++20 final flag, C++23 support
Microsoft intends to ship the final C++20 flag in VS 16.11 albeit with a few
parts missing due planned ABI breaking changes.
The current 16.11 Preview 1 toolchain version is 19.29.30129.3, so let's
restrict based on that.
2021-05-29 13:35:45 +03:00
Brad King
995f5b4e7b BinUtils: Find linker and librarian for OpenWatcom
Update our OpenWatcom linker and archiver rules to use the
`<CMAKE_LINKER>` and `<CMAKE_AR>` placeholders instead of
hard-coding the tool names.
2021-05-27 10:46:33 -04:00
Josef Angstenberger
74a2a7a477 Compiler/TI: Restore response file usage for linker
The commit 98fea8205e (Compiler/TI: Avoid response file usage for
linker, 2020-07-11, v3.19.0-rc1~495^2) disabled linker file usage by
default.  The previous settings were working, even if not for all cases.
Restore them and add an explanation in a comment.

Issue: #22233
2021-05-25 10:10:42 -04:00
Brad King
b78ba8bd31 Merge topic 'nvhpc-ninja-depfile'
364f6af1d7 NVHPC: Support Ninja dependency scanning
521cfc38a3 NVHPC: Support explicit language flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6136
2021-05-19 07:54:42 -04:00
Brad King
c23e2fa0c5 Merge topic 'nvhpc-ninja-depfile' into release-3.20
364f6af1d7 NVHPC: Support Ninja dependency scanning
521cfc38a3 NVHPC: Support explicit language flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6136
2021-05-19 07:54:41 -04:00
Robert Maynard
364f6af1d7 NVHPC: Support Ninja dependency scanning
Fixes: #22168
2021-05-18 12:56:46 -04:00
Robert Maynard
521cfc38a3 NVHPC: Support explicit language flags 2021-05-18 11:30:01 -04:00
Brad King
ca11096fd3 Merge topic 'cpp23_gcc'
9fbbebe3d0 GNU: C++23 support
c9a1e06a18 GNU: Final C++20 flags
05f8c8178d GNU: C++17 default version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6108
2021-05-11 09:19:12 -04:00
Raul Tambre
9fbbebe3d0 GNU: C++23 support
Added in GCC commit 78739c2df788ee5c868d998a6333d453317d8711, released in 11.1.
No lettered variant beforehand this time around.

Implements #22139.
2021-05-10 10:19:13 -04:00
Raul Tambre
c9a1e06a18 GNU: Final C++20 flags
Added in GCC commit fb26050409473f5be54465beca114b7e48de43aa, released in 11.1.
2021-05-10 10:19:13 -04:00
Raul Tambre
05f8c8178d GNU: C++17 default version
Changed in GCC commit 0801f419440c14f6772b28f763ad7d40f7f7a580, released in 11.1.
2021-05-10 10:19:13 -04:00
Josef Angstenberger
f015c36c5a
Modules: Fix typos and spelling in comments of generated code 2021-05-07 17:00:15 +02:00
Eisuke Kawashima
284d12a426 Fujitsu: Make explicit Fortran preprocessing under Ninja more robust
Tell the Fortran compiler to write preprocessor output directly to a
file, as we do for the GNU compiler.  The previous "redirect stdout"
approach could break checks using flags that add information to stdout
when called with `-###`.

Fixes: #22156
2021-05-06 13:11:48 -04:00
Brad King
3147f541f7 Merge topic 'intel-2021'
9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction
b7193ab18f Intel: Update Classic compiler version detection for 2021

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6052
2021-04-29 09:15:32 -04:00
Brad King
b7193ab18f Intel: Update Classic compiler version detection for 2021
The value of the `__INTEL_COMPILER` macro changed convention starting
in version 2021.

Fixes: #22120
2021-04-28 10:20:59 -04:00
Brad King
11530e5504 Merge topic 'ARMClang-cpu-arch-flags'
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
0078db3888 ARMClang: Separate cpu/arch flags from preceding flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jaeden Amero <kitware@patater.com>
Merge-request: !6035
2021-04-28 09:49:41 -04:00
Lingkai Dong
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:

    -mcpu=<name>[+[no]<feature>+...]

For example:

    -mcpu=cortex-a57+nocrypto+nofp+nosimd+crc

(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)

The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.

Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
2021-04-27 14:03:15 -04:00
Brad King
0078db3888 ARMClang: Separate cpu/arch flags from preceding flags
Suggested-by: Kim Kryger
2021-04-27 13:58:57 -04:00
unknown
625ef88a92 CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generators 2021-04-22 11:40:46 -04:00
Paul Zehner
cc0d2004b2 Fujitsu: Fix C90 standard flags
Fix typos from commit 3c867cff4a (Fujitsu: Add support for the Fujitsu
compiler in Trad mode, 2020-12-22).
2021-04-14 15:19:59 -04:00
Brad King
c3fab3e62d Merge topic 'cuda-depfile-ccbin'
8e38985db7 Makefiles: Fix dependency extraction with CUDA < 10.2 and host compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !5992
2021-04-08 07:46:15 -04:00
Brad King
8e38985db7 Makefiles: Fix dependency extraction with CUDA < 10.2 and host compiler
Since commit 2c71d051fa (Makefiles Generators: use compiler for
dependencies generation, 2020-10-18, v3.20.0-rc1~392^2) we invoke `nvcc`
for CUDA < 10.2 a second time in order to generate a depfile.  When
`CMAKE_CUDA_HOST_COMPILER` is set, the second invocation is missing its
`-ccbin=` option, even after refactoring in commit 8981e3e7cc
(NVIDIA-CUDA: rely on new capabilities for deps generation, 2020-12-02,
v3.20.0-rc1~362^2).

Ideally we should move the `-ccbin=` flag into `Compiler/NVIDIA-CUDA`,
but that will add `CMAKE_CUDA_HOST_COMPILER` support on Windows in
command-line generators but not the Visual Studio generators.
For now, add the flag to the depfile command specifically.

Fixes: #22037
2021-04-07 10:54:27 -04:00
Chuck Atkins
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
This should be front end compatible with vanilla clang but giving it a
unique identifier allows a project to pass additional options unique to
Fujitsu and outside the scope of a CMake builtin.
2021-03-31 09:14:45 -04:00
Chuck Atkins
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-30 10:32:53 -04:00
Brad King
31fc010259 Merge topic 'cray-fortran'
ef513fe3d1 Cray: Enable explicit Fortran preprocessing for Ninja generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5882
2021-03-08 13:07:20 -05:00
Brad King
ef513fe3d1 Cray: Enable explicit Fortran preprocessing for Ninja generator
Cray 11.0 adds support for preprocessing with output written to a
specified file (instead of always next to the source).  Use it to
enable Cray Fortran with the Ninja generator.

Patch-by: James Elliott
Fixes: #20731
2021-03-05 08:11:05 -05:00
Brad King
957a117c70 Merge topic 'android-r22'
005e2cdfb0 Android: Do not use gold for ndk >= r22
ed7a87f270 Tests: Update RunCMake.Android for NDK r22
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable
746906242d Android: Detect NDK version number

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5862
2021-03-03 11:11:58 -05:00
Haibo Huang
005e2cdfb0 Android: Do not use gold for ndk >= r22
Fixes: #21772
2021-03-03 10:28:56 -05:00
Raul Tambre
8211b4706f IntelLLVM: C17 support
Issue: #17755
2021-02-25 12:50:45 -05:00
Raul Tambre
b9c3acac02 GNU: C23 support
Added in commit 9f936c861383dc69e0053e34315d5d0262a19e8f, released in 9.1.
2021-02-25 18:22:32 +02:00
Raul Tambre
c9f0613c2a GNU: C17 support
Added in commit c76dc9c32d616eff1e0ae162042f1c0f8ca65fbf, released in 8.1.
Set as default in the same commit.

Issue: #17755
2021-02-25 18:22:32 +02:00
Raul Tambre
10a72c0f1c Clang: Default C standard doesn't depend on compatibility mode
MSVC compatibility mode doesn't affect the default standard.
2021-02-25 18:22:32 +02:00
Raul Tambre
6c2e309a66 Clang: Set standard flags according to frontend variant
They depend on the frontend not which compiler we're simulating.

Fixes #21771.
2021-02-25 18:22:32 +02:00
Raul Tambre
9f81591dbf Clang: MSVC-style C flags
Support added in LLVM commit d087d805acb664e885e9c31a916f6cfa5dbc2186, will be
released in Clang 13.
2021-02-25 18:22:32 +02:00
Raul Tambre
72f4984cdc Clang: C23 support
Added in LLVM commit d06f3917913d2558b771ccc48d838f8cd8993c01, released in
Clang 9.0.
2021-02-25 18:22:32 +02:00
Raul Tambre
82239d43f8 Clang: C17 default version
Switched in LLVM commit 91cdbd521a38495c66e30636943563ca70d3c022, released in
Clang 11.

Issue: #17755
2021-02-25 18:22:29 +02:00
Raul Tambre
9024fb632e Clang: C17 support
Added in LLVM commit 5b6c0f75e01571851b767dc63a3229c962f464f1, available since
Clang 6.

Issue: #17755
2021-02-25 18:22:10 +02:00
Raul Tambre
dcd599757f C23 support 2021-02-25 18:22:10 +02:00
Raul Tambre
93b7d3d292 C17 support
Implements #17755.
2021-02-25 18:22:10 +02:00
Raul Tambre
58d9525233 Clang: Correct default C standards for ancient versions
C11 was made default in LLVM commit ab506adf7d3ced6abcaf42f92de3d6cd15fa19e8,
released in 3.5.2.
C99 was made default in LLVM commit 17f76e04d244c80e70f1c81c94d4524b53d9772d,
released in 2.1. It was flipped a few times between C89 and C99 during the 2.1
cycle, but the C89 default never made it into a release.
2021-02-25 18:22:10 +02:00