Commit Graph

625 Commits

Author SHA1 Message Date
Brad King
cadc658e9d Merge topic 'armclang-typo'
2ff68c00e0 ARMClang: Fix typo in -Xlinker flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4916
2020-06-18 09:37:47 -04:00
Osama Moharam
2ff68c00e0 ARMClang: Fix typo in -Xlinker flag
Fix a typo from commit ef816610be (ARMClang: allow fallback to -march
and correct setting of --cpu flags, 2020-06-03, v3.18.0-rc1~18^2).
2020-06-18 07:43:22 -04:00
Brad King
8e61ebb75e Merge topic 'clang_cxx20'
b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17
5d26efe38f Clang: Add final C++20 flag for Clang 11.0+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4887
2020-06-15 09:01:44 -04:00
Raul Tambre
b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17 2020-06-13 11:29:55 +03:00
Raul Tambre
5d26efe38f Clang: Add final C++20 flag for Clang 11.0+
-std=c++20 superseded -std=c++2a in upstream Clang commit
24ad121582454e625bdad125c90d9ac0dae948c8.
2020-06-13 11:29:51 +03:00
Brad King
7925279c20 Merge topic 'add_explicit_lang_flag_to_compile_object_rule'
74b1c9fc8e Explicitly specify language flag when source LANGUAGE property is set
457170a476 CXX: Compile when possible with explicit `Cxx` language flag set
644d3b86eb C: Compile when possible with explicit `C` language flag set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4780
2020-06-11 07:47:30 -04:00
Robert Maynard
95700be52d CUDA: Teach CMake that NVCC 11 supports cuda_std_17 2020-06-10 13:27:51 -04:00
Robert Maynard
457170a476 CXX: Compile when possible with explicit Cxx language flag set
Issue: #14516, #20716
2020-06-09 16:20:53 -04:00
Robert Maynard
644d3b86eb C: Compile when possible with explicit C language flag set
Issue: #14516, #20716
2020-06-09 16:20:53 -04:00
Raul Tambre
0f88b7a592 CUDA: Fix Clang depfile flags when simulating MSVC
__compiler_clang() doesn't call __compiler_gnu() if we're emulating MSVC. Thus
CMAKE_DEPFILE_FLAGS_CUDA remains unset and compiling doesn't work, due to NVCC
dependency injection workaround in CMakeCUDAInformation.cmake, which triggers
for Ninja if they're not set.
Always set the depfile flags to fix this. Most other compiler modules seem to
do the same.
2020-06-08 07:54:51 -04:00
Osama Moharam
ef816610be ARMClang: allow fallback to -march and correct setting of --cpu flags
allows cmake to fall back to CMAKE_SYSTEM_ARCH in case CMAKE_SYSTEM_PROCESSOR is not in armclang -mcpu=list
additionally checks if CMAKE_SYSTEM_PROCESSOR belongs to armlink --cpu=list

Fixes: #19962
2020-06-03 16:58:31 +02:00
Brad King
007109b20f Merge topic 'armclang-armlink'
73fb6ac82b ARMClang: Add support for armlink

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4811
2020-06-03 06:10:14 -04:00
Osama Moharam
73fb6ac82b ARMClang: Add support for armlink
sets CMAKE_LIBRARY_PATH_FLAG to '--userlibpath=' when using armlink.

Fixes: #20761
2020-06-02 11:32:32 -04:00
Brad King
e76c11aa7c Merge branch 'backport-3.17-pch-no-Fortran' into pch-no-Fortran 2020-06-02 08:24:11 -04:00
Brad King
10c88c4337 PCH: Do not enable GNU or Intel PCH settings for Fortran
The PCH settings are shared by C and CXX languages but do not make sense
for Fortran.  In particular, `CMAKE_PCH_EXTENSION` should not be set
because it can overwrite the value set for C/C++ languages, which may
have a different compiler vendor than the Fortran compiler.

Fixes: #20752
2020-06-02 08:23:40 -04:00
Kyle Edwards
97fa63c09b ASM: Fix preprocessor definition flags for GNU 'as' tool
Fixes: #20780
2020-06-01 14:43:37 -04:00
Brad King
eb705b9531 Update links to gitlab.kitware.com repos to add -/
GitLab now uses a `/-/` component between the `group/project` part of
the URL and the `{issues,merge_requests,tree}` part so that it can
support `group/subgroup/project` with arbitrary depth.
2020-05-26 11:38:01 -04:00
Brad King
62816ff88c Merge topic 'fortran-preprocess-property'
3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF
66c4e87282 Ninja: Add helper functions to generate Fortran build
5cca1ec893 Ninja: Add helper functions to generate Fortran preprocess rule
b0a6161190 Fortran: Add Fortran_PREPROCESS property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4659
2020-05-22 10:35:10 -04:00
Brad King
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime 2020-05-22 06:50:19 -04:00
Peter Hill
b0a6161190 Fortran: Add Fortran_PREPROCESS property
Issue: #18870
2020-05-21 11:44:14 -04:00
Robert Maynard
e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain
Since commit 0d0145138f (CUDA: Add abstraction for cuda runtime
selection, 2019-11-29, v3.17.0-rc1~83^2) we add CUDA runtime library
selection flags by default.

To maintain backwards compatibility the default CUDA runtime
library needs to be computed based on what libraries are found
on the initial compiler invocation. For example a toolchain
could establish initial flags that have all CUDA compilations
using the runtime version, and if we don't detect this we will
try to link to both the static and shared runtime.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #20708
2020-05-21 11:15:03 -04:00
Raul Tambre
5df21adf46 CUDA: Add support for Clang compiler
When crosscompiling we pass the sysroot.

We need to try various architecture flags. Clang doesn't automatically
select one that works.  First try the ones that are more likely to work
for modern installations:

* <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for
          future compatibility.
* <=sm_20 is removed since CUDA 9.0, try sm_30.

Otherwise fallback to Clang's current default. Currently that's `sm_20`,
the lowest it supports.

Separable compilation isn't supported yet.

Fixes: #16586
2020-05-15 17:46:51 +03:00
Jiri Malak
d3640dbdd5 OpenWatcom: Organize and update C/C++ toolchain command lines 2020-04-28 09:36:05 -04:00
Jiri Malak
7aa9e89b1c OpenWatcom: Move non-Windows settings to Modules/Compiler
Restructure OpenWatcom toolchain support files to simplify adding of new
targets DOS, OS/2 and Linux including cross-compilation.
2020-04-28 09:36:04 -04:00
Brad King
dba914aa31 Merge topic 'ti-compilers-fix-cxx'
65c1320719 Compiler/TI: Fix C++ toolchain command-lines
4110d9dffb Compiler/TI: Fix linker command line for C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4627
2020-04-21 08:15:31 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Marc Chevrier
ec48e023f6 CUDA: Add information for LINKER: pattern translation 2020-04-19 15:04:56 +02:00
Alekseev Alexey
65c1320719 Compiler/TI: Fix C++ toolchain command-lines
Applied commit 5a0fc68312 (TI: Fix C toolchain command-lines, 2020-03-03) for C++:
Fix `armar` arguments.  Fix the linker `--map_file=` argument.
Enable response files.
2020-04-18 12:12:20 +03:00
Alekseev Alexey
4110d9dffb Compiler/TI: Fix linker command line for C++
Just like C, libraries must be in the last part of the linker.
Commit 89317915d9 (Compiler/TI: Pass libraries as last part to linker, 2016-06-02)
2020-04-18 12:12:20 +03:00
Raul Tambre
60e60b9201 GNU: Disable depfiles in try-compile mode only for GCC
Disabling them causes issues for Clang's CUDA frontend.
Since this is a GCC bug, simply check for GCC.
2020-04-07 09:33:25 -04:00
Raul Tambre
5f02add366 CUDA: Refactor PTX compilation flag into compiler modules 2020-04-07 09:33:25 -04:00
Raul Tambre
25439c7d62 Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()
These standard flags are the same for CXX, OBJCXX and CUDA.
Refactor them into a single macro to reduce duplication and so we can easily reuse them.

Updated bootstrap script to search in the general Clang module instead of the language-specific.
2020-04-07 09:33:09 -04:00
Brad King
85f87c9d40 Merge topic 'xl-cxx14'
46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support
4aaa9ea96c XL: C++14 language level flags are only available on Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4551
2020-04-01 10:42:19 -04:00
Brad King
46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support
Since commit b0f46c48f6 (CompileFeatures: Now able to presume full
language level support, 2019-03-06, v3.15.0-rc1~265^2~1) we pretend that
the XL compiler has full C++11 and C++14 support so that projects
specifying granular features will at least get the corresponding
compiler mode.  This is a work around for our lack of a full feature
check table for this compiler that works in common cases.  Add a comment
explaining this.

Issue: #20521
2020-03-31 10:35:56 -04:00
Brad King
4aaa9ea96c XL: C++14 language level flags are only available on Linux
Since commit 458ea9d76c (XL: Add C++14 language level flags, 2019-04-15,
v3.15.0-rc1~226^2) we use `-qlanglvl=extended1y` for C++14 with XL 16.1.
However, that flag is only supported on a Linux host.

Issue: #20521
2020-03-31 10:35:56 -04:00
Brad King
f670435715 Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4499
2020-03-27 08:03:30 -04:00
Cristian Adam
2ce08e5489 PCH: add an option to disable -Winvalid-pch
Fixes: #20295
2020-03-26 14:24:46 +01:00
Daan De Meyer
d8622fbd0f Modules: Collapse consecutive whitespace in strings 2020-03-23 21:34:17 +01:00
Brad King
eea528fd92 Merge topic 'gnu-as'
9728839b9e ASM: Fix executable link lines with GNU 'as' tool as CMAKE_ASM_COMPILER
5932f0be4f ASM: Fix depfile flags for GNU 'as' tool
0d0aa98c84 ASM: Record vendor-specific output matched to identify assembler
ee3ec27465 CMakeDetermineCompilerId: Set locale to C for vendor output match

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4460
2020-03-16 11:31:25 -04:00
Brad King
ba216592fc Merge topic 'cuda_language'
f75bea1071 CUDA: Abstract language flag to compiler modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4464
2020-03-13 10:43:57 -04:00
Brad King
9728839b9e ASM: Fix executable link lines with GNU 'as' tool as CMAKE_ASM_COMPILER
The GNU `as` tool does not know how to drive linking like the C compiler
does.  When using `as` as the compiler, use the linker directly.
2020-03-13 09:55:36 -04:00
Brad King
5932f0be4f ASM: Fix depfile flags for GNU 'as' tool
The GNU `as --help` shows `--MD <file>` as an option to generate depfiles
as needed by Ninja.  There is no `-MT <target>` flag but fortunately the
generated files automatically account for the `-o <obj>` flag.

Issue: #20426
2020-03-13 09:55:36 -04:00
Brad King
2ca34f0685 Merge topic 'apple-clang-flags-c++17'
a67f2d00d8 Apple Clang: add flags for C++17 standard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4468
2020-03-12 09:33:19 -04:00
Marc Chevrier
a67f2d00d8 Apple Clang: add flags for C++17 standard 2020-03-12 08:09:12 -04:00
Raul Tambre
f75bea1071 CUDA: Abstract language flag to compiler modules
Separate this detail out into compiler-specific modules.
Required for Clang support, as it uses slightly different language flags.
2020-03-11 21:30:09 +02:00
Oliver Blasius
5a0fc68312 TI: Fix C toolchain command-lines
Fix `armar` arguments.  Fix the linker `--map_file=` argument.
Enable response files.
2020-03-09 12:02:20 -04:00
Brad King
210b0b99a9 XL: Fix using Fortran modules from their output directory
The XL Fortran compiler's `-qmoddir=` flag sets the module output
directory but does not add the directory to the search path for using
modules.  This is inconsistent with other compilers like the GNU Fortran
compiler's `-J` flag that does both.  In order to make these consistent,
add the module output directory with a `-I` flag on the XL Fortran
compiler so that it will be searched when using modules too.

This fixes our `FortranModules` test's coverage of submodules on
Ninja + XL.  That test places module files in a subdirectory that with
Ninja is not the current working directory when the compiler runs.

Fixes: #20400
2020-02-28 10:37:11 -05:00
Brad King
1d338dcf46 Merge topic 'cuda-non-device-link' into release-3.17
7da2c8c543 Merge branch 'backport-cuda-non-device-link'
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4376
2020-02-25 08:54:45 -05:00
Brad King
64ed4f6f99 Merge topic 'cuda-non-device-link'
7da2c8c543 Merge branch 'backport-cuda-non-device-link'
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4376
2020-02-25 08:54:45 -05:00
Brad King
7da2c8c543 Merge branch 'backport-cuda-non-device-link' 2020-02-24 13:34:13 -05:00