Commit Graph

352 Commits

Author SHA1 Message Date
Daniel Pfeifer
fc51b92c80 Intel: avoid variables in language standard flags
In the bootstrap script, we want to be able to extract language standard
flags using sed.  Make sure the content of the flag varianbles can be
passed unmodified to the compiler.
2017-05-26 08:21:50 +02:00
Andreas Weis
68ea936ff5 Added space after IAR response file flag
Without the space between the flag and the filename, IAR will fail to
parse the arguments correctly.
2017-05-23 07:25:27 +02:00
Brad King
c9d9a3fb39 Merge topic 'pgi-fix-windows'
4eb15824 Windows-PGI: Add platform definitions
a94ae96e Windows-PGI: Adapt default compiler flags
c2c2d366 ImplicitLinkInfo: Add support for PGI on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !794
2017-05-22 10:37:57 -04:00
Christian Pfeiffer
a94ae96e6e Windows-PGI: Adapt default compiler flags
PGI demands -Bdynamic (/MD equivalent) for linking together dynamic
libraries, so we should make it our default mirroring the settings of
e.g. Visual C++ and Intel C++.
2017-05-20 20:02:51 +02:00
Ruslan Baratov
75accaae8b GCC: more patterns for ar/ranlib 2017-05-14 12:31:26 +03:00
Brad King
592206a157 Merge topic 'add_cuda_cxx14_flag'
036ffe81 CUDA: Add support for the C++14 standard flag.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !830
2017-05-12 09:13:19 -04:00
Brad King
5d13fe2822 Features: Record features for SunPro C 5.13 and 5.14 2017-05-11 15:59:48 -04:00
Robert Maynard
036ffe815a CUDA: Add support for the C++14 standard flag.
CUDA 9 toolkit has announced support for C++14 flag, so lets allow users
to use it.
2017-05-11 13:42:42 -04:00
Brad King
20c838da6b Merge topic 'sunpro-fpp-fix'
1cd40bd2 SunPro: Use -fpp to process all files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !826
2017-05-11 09:59:47 -04:00
Christian Pfeiffer
1cd40bd226 SunPro: Use -fpp to process all files
By using only -F, SunPro does not process files that don't have a .F or
.F90 extension. This means that the preprocess rules don't quite work as
expected, for instance breaking the Ninja generator's behavior during
cmake_ninja_depends.
2017-05-10 19:33:48 +02:00
Chuck Atkins
67c9f47901 PGI: Fix typo in compiler version test for language standards 2017-05-10 12:25:44 -05:00
Chuck Atkins
1a09a7d992 SunPro: Add more flags for C language standards 2017-05-04 14:10:07 -04:00
Brad King
f15f905bab Features: Record standards and features for SunPro 5.14
Oracle Studio 12.5 adds support for C 11 and associated standard flags.
It also adds a few more C++ 11 features.
2017-05-03 13:13:43 -04:00
Brad King
bf3c08d648 Merge topic 'port-language-default-to-common-macro'
d9089876 AppleClang: Use common compiler macros for language standard default
174c02e1 SunPro: Use common compiler macros for language standard default
08fa2ba8 Clang: Use common compiler macros for language standard default
0198502f Intel: Use common compiler macros for language standard default
d1aa2b3f GNU: Use common compiler macros for language standard default
87b9d6d9 XL: Use common compiler macros for language standard default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !787
2017-05-03 11:01:12 -04:00
Chuck Atkins
0225417f60 PGI: Fix typo in logic for C standard flags 2017-05-02 10:08:56 -04:00
Chuck Atkins
d908987634 AppleClang: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Chuck Atkins
174c02e149 SunPro: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Chuck Atkins
08fa2ba8d0 Clang: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Chuck Atkins
0198502ff4 Intel: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Chuck Atkins
d1aa2b3f60 GNU: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Chuck Atkins
87b9d6d93f XL: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Brad King
a9e48968bb Merge topic 'add-language-standards-to-more-compilers'
9b97cb55 PGI: Add language standards for PGI
daae564d Cray: Add language standards for the Cray compiler
25e83ce5 CompileFeatures: Let STD compile options be a list
1de70845 Compilers: Add common macros to be used by various compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !784
2017-05-02 08:24:06 -04:00
Chuck Atkins
9b97cb5562 PGI: Add language standards for PGI 2017-05-01 15:15:30 -04:00
Chuck Atkins
daae564d87 Cray: Add language standards for the Cray compiler 2017-05-01 15:15:30 -04:00
Chuck Atkins
1de7084501 Compilers: Add common macros to be used by various compilers
With numerous compilers now supporting multiple language standards in CMake,
some common design patterns have begun to emerge.  This is intended to
be a collection of macros implementing many of those common design
patterns that can be factored out and leveraged by many compilers.
Currently this only contains the code to set the default language
standard of not preset.  More functionality will be added in the future
as appropriate.
2017-05-01 15:15:23 -04:00
Brad King
e17b179184 Features: On SunPro link with language standard compiler flag
When C++ feature requirements or `CXX_STANDARD` cause us to compile
on SunPro with the `-std=c++11` option, link with the option too.
This is needed to make the compiler use the matching standard library.
2017-05-01 10:33:06 -04:00
Brad King
a2a13e8b48 Merge topic 'ipo-clang'
7d057b27 Clang IPO (LTO) support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !717
2017-05-01 09:15:46 -04:00
Chuck Atkins
6555286c55 XL: Add C and C++ language level flags 2017-04-28 11:48:32 -04:00
Ruslan Baratov
7d057b2738 Clang IPO (LTO) support 2017-04-28 17:13:56 +03:00
Chuck Atkins
f320907b3d XL: Fix the use of the -qhalt flag for varying OSs
The valid settings to pass to the IBM XL compiler for the -qhalt flag
vary widely by language and platform.  Based on existing documentation,
the following table shows which error levels are valid to pass to
-qhalt= since -qhalt=e is not always available.

OS       |  xlc  |  xlC  |   xlf   |
---------|-------|------------------
AIX      | iwes  | iw s  | ilwesu  |
BlueGene | iwes  | iwes  | ilwesu  |
OS X     | iwesu | iwesu | ilwesu  |
Linux    |  w    |  w    | ilwesu  |
2017-04-27 13:29:28 -04:00
Aleix Pol
0903531964 Autogen: Pass explicit predefines header to moc if possible
Qt is relying on whoever calls moc to include a file with the predefined
values that will be used by the compiler, otherwise moc takes wrong
paths and weird things happen.
Instead, generate an include file and feed it to all mocs to make sure
it's generating correct code.

Co-Author: Sebastian Holtermann <sebholt@xwmw.org>
Fixes: #16640
2017-04-20 08:59:07 -04:00
Brad King
820af5f797 Merge topic 'lang-specific-binutils'
73934188 Rename CMAKE_GCC_{AR,RANLIB} to CMAKE_LANG_COMPILER_{AR,RANLIB}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !656
2017-04-05 10:15:40 -04:00
Ruslan Baratov
7393418844 Rename CMAKE_GCC_{AR,RANLIB} to CMAKE_LANG_COMPILER_{AR,RANLIB}
The variables recently added by commit b9d36826 (Add 'CMAKE_GCC_AR' and
'CMAKE_GCC_RANLIB' variables, 2017-03-08) are more appropriately managed
with language-specific names rather than toolchain-specific names.
2017-04-03 14:10:50 -04:00
Brad King
7c93f6f21d Merge topic 'intel-compile-features'
4af0c9da Features: Update features for Intel C++ 17.0.2 on UNIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !652
2017-04-03 09:25:04 -04:00
Brad King
4af0c9daf4 Features: Update features for Intel C++ 17.0.2 on UNIX
Intel 17.0.2 on UNIX introduced a regression from 17.0.1 in its
definition of `__cpp_constexpr` in `-std=c++14` mode.  It incorrectly
defines it as `200704` instead of the expected `201304`.  Fix our
feature detection table to account for this.
2017-03-31 14:29:18 -04:00
Brad King
8772fc81c4 Merge topic 'ipo-policy-CMP0069'
dfa8263f Implement interprocedural optimization for GNU compilers
1588a577 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
a7575700 Refactoring: s,GetFeatureAsBool,IsIPOEnabled,
e05835c3 CheckIPOSupported: Visual Studio and Xcode generators do not support IPO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !568
2017-03-31 10:38:08 -04:00
Ruslan Baratov
dfa8263f4b Implement interprocedural optimization for GNU compilers
Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU
compilers by activating their link-time-optimization (LTO) flags.
2017-03-30 14:56:52 -04:00
Brad King
a820327d1a Merge topic 'sdcc-compiler-id'
5695558f SDCC: Fix identification of current sdcc compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !644
2017-03-30 08:59:05 -04:00
Brad King
5695558f4a SDCC: Fix identification of current sdcc compiler
The sdcc compiler no longer defines the `SDCC` preprocessor macro.
Instead `__SDCC_VERSION_MAJOR` and similar component-wise macros are
defined.  Use them instead if defined.

Issue: #16746
2017-03-29 13:21:49 -04:00
Brad King
8fc934de0e GNU-FindBinUtils: Avoid setting policy CMP0054
The `cmake_policy(SET)` call triggers `CMP0011` warnings when this
module is used in a project that does not set `CMP0011` to NEW.  We
could avoid these with a `cmake_policy` PUSH/POP pair, but it is simpler
to adjust our code to not trigger `CMP0054` in the first place.
2017-03-10 10:46:11 -05:00
Ruslan Baratov
b9d36826c5 Add 'CMAKE_GCC_AR' and 'CMAKE_GCC_RANLIB' variables 2017-03-09 04:28:01 +08:00
Brad King
d1530cc9a5 Merge topic 'cuda-msvc-flags'
55fb46d2 CUDA: Fix default compiler flags on Windows
d7c80f60 CUDA: Fix test cases to not override CUDA flags
2017-02-16 13:15:35 -05:00
Brad King
55fb46d273 CUDA: Fix default compiler flags on Windows
Fix the default values of `CMAKE_CUDA_FLAGS[_<CONFIG>]` on Windows to
make the host compiler flags match those produced for C++ by the
`Platform/Windows-MSVC` module.  This makes the flags consistent with
those used for C++.
2017-02-15 11:12:12 -05:00
Brad King
8ba5c21db7 Merge topic 'cuda-no-Os'
59ed323d CUDA: Do not use non-existent -Os flag for nvcc
2017-02-15 08:24:02 -05:00
Brad King
59ed323d46 CUDA: Do not use non-existent -Os flag for nvcc
Fix the CUDA MinSizeRel configuration flags to avoid using the `-Os`
flag that nvcc does not support.
2017-02-14 14:49:53 -05:00
Rolf Eike Beer
e2ee097147 g++ knows about C++98 selection flags since at least 3.4
https://gcc.gnu.org/onlinedocs/gcc-3.4.0/gcc/C-Dialect-Options.html#C-Dialect-Options
2017-02-08 21:04:31 +01:00
Rolf Eike Beer
37ed860ad1 GNU C++: record that -fvisibility-inlines-hidden is available since 4.0
See https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Option-Summary.html
2017-02-02 18:28:56 +01:00
Rolf Eike Beer
94a8ee6fd0 GNU C: record that C99 is available since at least 3.4 2017-02-02 18:28:56 +01:00
Brad King
5d70894d40 Features: Update version of Intel Compiler on Windows supporting C 11
The Intel Compiler 15.0.0 on Windows does not support `-Qstd=c11`.
Bump our version requirement to 16 to use that flag.
2017-02-01 08:55:50 -05:00
Rolf Eike Beer
24d73fa0eb GNUC: also check __GNUG__ define when checking for g++
At least the scratchbox compiler for the N900, which basically is a gcc 4.2,
sets only __GNUG__ in C++ mode, but not __GNUC__. It does indeed set
__GNUC_MINOR__ and __GNUC_PATCHLEVEL__. Extend the compiler detection code for
GNU compilers in C++ mode to look at __GNUG__ in case __GNUC__ is absent.
2017-01-25 21:53:40 +01:00