Commit Graph

431 Commits

Author SHA1 Message Date
Marc Chevrier
66ea1a3795 LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Brad King
f719a13c28 Features: Add special case to disable relaxed constexpr for Intel 18
Intel compilers define `__cpp_constexpr` to `200704` even in C++14 mode.
This indicates that the `cxx_relaxed_constexpr` feature is not
available.  However, Intel 17 and above document support for it.  In
commit v3.8.0~9^2 (Features: Update features for Intel C++ 17.0.2 on
UNIX, 2017-03-31) we added a special check for this case.  Intel 17 and
19 work.  However, Intel 18 does not seem to work and fails our test
case.  Add a special case to disable the feature for Intel 18.
2018-06-04 13:52:11 -04:00
Brad King
07bddeae14 Merge topic 'fix-ti-c-standard'
9e27881bb1 TI: Add support for C language standards

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2131
2018-06-04 11:34:35 -04:00
Arnaud Gelas
9e27881bb1 TI: Add support for C language standards
Set C90 and C99 compile options for TI compiler.

Fixes: #18061
2018-06-04 10:48:02 -04:00
Sebastian Holtermann
caa138c1a5 Move GNU COMPILER_PREDEFINES_COMMAND from Platform to Compiler
Moves `CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND` from linux specific
[Modules/Platform/Linux-GNU.cmake](Modules/Platform/Linux-GNU.cmake) to
[Modules/Compiler/GNU.cmake](Modules/Compiler/GNU.cmake).
This enables compiler predefines generation (in AUTOMOC) on all
platforms that run gcc (and clang).
2018-06-01 09:21:06 +02:00
Henry Schreiner
1fb2812d5b CUDA: Add compiler detection for CUDA < 7.5
If the CUDA version macros are not defined, run `nvcc --version` and
extract the version from its output.

Fixes: #17920
2018-04-23 11:26:56 -04:00
Ephi Sinowitz
d67962c55a SunPro,XL: Add depfile flags to support Ninja generator
Add CMAKE_DEPFILE_FLAGS_${lang} to SunPro and XL. These flags are used
by the Ninja generator.
2018-04-17 15:35:49 -04:00
Brad King
77705a2c28 Merge topic 'clang-cl-std'
3f82c5904d Clang: Add standard flags support when simulating MSVC
8381bc12ad Clang: Avoid extra C++ feature detection when simulating MSVC
6cddf7ba32 Clang: Refactor standard flags logic when simulating MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1906
2018-04-13 10:22:26 -04:00
Brad King
d59cd3b131 Merge topic 'features-msvc-2017'
5f4272cc06 Features: Record for VS 2017 through 15.6

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1903
2018-04-12 11:31:42 -04:00
Ruben Van Boxem
3f82c5904d Clang: Add standard flags support when simulating MSVC
When Clang 3.9 simulates MSVC 19.0 or higher it knows the `-std:` flags
that such versions of MSVC defines.

Fixes: #17866
2018-04-11 14:50:22 -04:00
Brad King
8381bc12ad Clang: Avoid extra C++ feature detection when simulating MSVC
Apply the optimization from commit v3.10.0-rc1~131^2 (MSVC: Avoid
unnecessary C++ feature detection steps, 2017-09-11) to the case of
Clang simulating a version of MSVC that does not define standards.

Issue: #17274
2018-04-11 14:47:28 -04:00
Brad King
6cddf7ba32 Clang: Refactor standard flags logic when simulating MSVC
Consolidate the compile options and standard defaults branches.
Add comments.
2018-04-11 14:45:16 -04:00
Daniel Filipe
5f4272cc06 Features: Record for VS 2017 through 15.6
VS 15.3 has more features than we recorded in commit v3.7.0-rc1~156^2~2
(Features: Record features for VS 15 Preview 4, 2016-09-05).

While at it, update comments and simplify some cases.
2018-04-11 11:27:07 -04:00
Brad King
12e6796b62 Android: Do not pass non-existent Clang -std flags
Android NDK r16b comes with

  Android clang version 5.0.300080  (based on LLVM 5.0.300080)

Although it claims version 5, it does not support the `-std=c++17`
or `-std=c++2a` flags that upstream Clang does.

Android NDK r17-beta1 comes with

  Android (4639204 based on r316199) clang version 6.0.1

that does have the flags.
2018-04-02 15:15:20 -04:00
Brad King
1b6ec4b9e3 Merge topic 'features-c++20'
8570dc7f64 Help: Update compiler versions in cmake-compile-features.7.rst
874d3d2948 Help: Add release note for C++ 20 support
7f295b1bd3 Features: Activate C++ 20 support for Clang 5.0+
71cb8ce3a1 Features: Activate C++ 20 support for GNU 8.0+
8f146c4508 Features: Activate C++ 20 support for MSVC 19.12.25835+
7fe580a362 Features: Add infrastructure for C++ 20 language standard
1b328e09a3 Features: Use -std=c++17 for C++ 17 on Clang 5.0+
0bc3e5788a Features: Use -std=c++17 for C++ 17 on GNU 8.0+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1892
2018-04-02 10:01:23 -04:00
Brad King
a53cf69022 Features: Record C features for MSVC
The MSVC C compiler has no notion of C language standards or flags.
Tell CMake to assume that all language standards are available.
Record available C language features depending on the version of
the compiler.

Fixes: #17858
2018-03-29 10:40:13 -04:00
Brad King
7f295b1bd3 Features: Activate C++ 20 support for Clang 5.0+ 2018-03-27 07:42:07 -04:00
Brad King
71cb8ce3a1 Features: Activate C++ 20 support for GNU 8.0+ 2018-03-27 07:42:07 -04:00
Brad King
8f146c4508 Features: Activate C++ 20 support for MSVC 19.12.25835+ 2018-03-27 07:42:07 -04:00
Brad King
7fe580a362 Features: Add infrastructure for C++ 20 language standard
Issue: #17849
2018-03-27 07:40:54 -04:00
Brad King
1b328e09a3 Features: Use -std=c++17 for C++ 17 on Clang 5.0+
Clang 5.0 added support for the `-std=c++17` flag.
2018-03-26 14:23:41 -04:00
Brad King
0bc3e5788a Features: Use -std=c++17 for C++ 17 on GNU 8.0+
GNU 8 now documents official support for the `-std=c++17` flag.
2018-03-26 14:23:41 -04:00
Brad King
4267960fc9 Features: Record for SunPro 5.15
Oracle Developer Studio 12.6 adds support for more C++ 11 features.
2018-03-20 11:48:22 -04:00
Brad King
fc96d99c3e Features: Record initializer list support for Intel 14 and above
Features recorded by commit v3.6.0-rc1~120^2~5 (Features: Record
standards and features for Intel C++ on UNIX, 2016-04-28) for the Intel
compiler left out initializer list support because our test case in
`Tests/CompileFeatures/cxx_generalized_initializers.cpp` caused an
internal compiler error.  It turns out this is because the Intel
compiler asserts the `initializer_list` constructor signatures to verify
that they match its own `<initializer_list>` header.  It was our dummy
implementation used to test the language feature without any headers
that caused the ICE.  Revise it to use a constructor signature accepted
by the Intel compiler.

Fixes: #17829
2018-03-16 07:47:42 -04:00
Brad King
57f35bba84 Merge branch 'cuda-no-device-link-rsp' into release-3.11
Merge-request: !1831
2018-03-07 10:52:54 -05:00
Brad King
f64732f59b CUDA: Do not pass unsupported @rspfile arguments to NVCC
The nvcc compiler does not support `@<rspfile>` arguments.  It does
offer a `--options-file` argument that can be investigated later.

Fixes: #17797
2018-03-07 10:30:35 -05:00
Brad King
eb1a9be4b6 XL: Recognize compilers identified by __ibmxl__
IBM XL C/C++ for Linux versions 13.1.6 and above no longer define
`__IBMC__` or `__IBMCPP__` by default (see `-qxlcompatmacros`).
Instead `__ibmxl__` now identifies the compiler along with some
related new version macros.

Fixes: #17784
2018-03-06 07:43:04 -05:00
Grzegorz Dobinski
cab9af7e97 Compiler/TI: Fix depfile generation for C++
In commit v3.11.0-rc1~466^2 (Compiler/TI: Add support for depfile
generation for Ninja, 2017-10-16) the flag for C++ was added in a
variable with a typo in its name.  Fix the spelling.

Issue: #17360
2018-02-20 11:52:11 -05:00
Brad King
a271286f41 Merge topic 'intel-cxx17-flags'
c3d576f5 Intel: Add C++17 compiler options
4a5727d3 Intel: Correct the C11 ext flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1711
2018-01-29 08:04:28 -05:00
Christian Pfeiffer
c3d576f5d6 Intel: Add C++17 compiler options
Since Intel C++ 18.0, some C++17 features are supported if the flags
-std=c++17, respectively /Qstd=c++17 are given.

Fixes: #17687
2018-01-27 15:09:58 +01:00
Christian Pfeiffer
4a5727d375 Intel: Correct the C11 ext flag
Intel does not support a 'gnu11' standard flag, only 'c11'.
2018-01-27 15:08:00 +01:00
Brad King
d1d8daf15a Merge topic 'xl-qoptfile'
c4dc6485 XL: Enable use of response files for includes and objects
e342e410 Makefile,Ninja: Use tool-specific response file flag for include dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1691
2018-01-25 08:36:47 -05:00
Brad King
499e36d932 Merge topic 'fix-cray-pic'
b886b46c Cray: Add common PIC flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1692
2018-01-25 08:36:17 -05:00
Brad King
c4dc6485eb XL: Enable use of response files for includes and objects
The IBM XL compiler supports response files via `-qoptfile=<file>`
instead of `@<file>`.
2018-01-24 14:31:53 -05:00
Chuck Atkins
b886b46ccb Cray: Add common PIC flags
Fixes #17208
2018-01-24 09:09:08 -06:00
Brad King
6c3f374e99 MSVC: Avoid warning when enabling ASM language with C compiler
The `CMakeASMInformation` module warns when no compiler-specific module
is found for the `ASM` language.  Add a minimal `Compiler/MSVC-ASM`
module to avoid the warning for MSVC.

Fixes: #17532
2018-01-10 14:04:04 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
Brad King
57199deafa Merge topic 'fix-iar-binutils-for-cxx'
e4707048 IAR: FindBinUtils should work for CXX as well as C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1572
2017-12-12 08:02:55 -05:00
Islam Amer
e4707048c0 IAR: FindBinUtils should work for CXX as well as C
The IAR compiler test works when a project specifies LANGUAGES C CXX
but fails if CXX comes before C. This change makes it work regardless
of the order.
2017-12-12 08:00:16 -05:00
Brad King
f8f3338582 Merge topic 'flang-windows'
3c368228 Flang: Add support for compiling sources on Windows
72d27964 Flang: Identify as simulating MSVC on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1430
2017-11-08 09:05:13 -05:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Brad King
93cd333103 Merge topic 'mingw-clang-c-compile-features'
f86879a0 Record C compile features flags for MinGW Clang on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1435
2017-11-01 07:40:35 -04:00
Brad King
8d1341f4ff Merge branch 'mingw-clang-c-compile-features' into release-3.10
Merge-request: !1435
2017-11-01 07:39:02 -04:00
Brad King
f86879a04c Record C compile features flags for MinGW Clang on Windows
This was done for C++ by commit v3.5.0-rc1~69^2 (Record compile features
for MinGW Clang on Windows, 2016-01-11).  Make the same change for C.
The `UNIX` condition on Clang C compiler features was already dropped by
refactoring in commit v3.9.0-rc1~17^2~4 (Compilers: Port to use default
cmake_record_lang_compile_features macros, 2017-05-10).

Our documentation already claims support for this combination.  This
was simply an oversight when support was added for MinGW Clang C++.

Issue: #15897
Issue: #15943
2017-11-01 07:28:38 -04:00
Isuru Fernando
72d27964b9 Flang: Identify as simulating MSVC on Windows
In `CMakeFortranCompilerId.F.in`, take the `_MSC_VER` out of the
Intel-specific block so it will trigger for other compilers like Flang.
In `Compiler/Clang.cmake`, switch off Fortran too.
2017-10-31 08:47:06 -04:00
Brad King
9ded2fad79 Merge topic 'flang-remove-boundscheck'
3aeff21d Flang: Remove unsupported fbounds-check flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1393
2017-10-23 08:21:23 -04:00
Brad King
51b4f12773 Merge branch 'flang-remove-boundscheck' into release-3.10
Merge-request: !1393
2017-10-19 13:05:15 -04:00
Christian Pfeiffer
3aeff21df7 Flang: Remove unsupported fbounds-check flag
The Flang compiler neither supports nor documents -fbounds-check leading
to -Wunused-command-line-argument warnings with the default Debug flags.
2017-10-19 13:04:50 -04:00
Nico Müller
ad9327d936 Compiler/TI: Add support for depfile generation for Ninja
TI C/C++ compiler are now able to generate dependency files during
compilation.

Fixes: #17360
2017-10-18 09:43:22 -04:00
Thomas Stenersen
11f4c19d7b IPO: Fix support for spaces in path to archive tools
In the normal archiving rules the ``<CMAKE_AR>`` placeholder is replaced
by the generators with a properly-quoted path to the tool.  In the IPO
rules we specify the tools directly, so we need to quote them.

Fixes: #17326
2017-10-06 08:15:55 -04:00