Commit Graph

363 Commits

Author SHA1 Message Date
Brad King
ba247ccaba IPO: Consider support for each language separately
We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and
Fortran languages.  Do not try to enable support for other languages.
Furthermore, each language builds with a different compiler, so check
for support by CMake and the compiler for each language independently.

Fixes: #16944
2017-06-14 10:36:57 -04:00
Chuck Atkins
3c1ecb5214 Intel: Fix missing C std default for 12.0 <= ver < 12.1 2017-05-31 13:09:49 -04:00
Chuck Atkins
f70b0bb365 SunPro: Make sure all known versions get CXX98 defaults 2017-05-31 13:09:42 -04:00
Chuck Atkins
220ede74ff GNU: Fix language defaults for 3.4 2017-05-30 09:35:06 -04:00
Chuck Atkins
a40e6ba88d Clang: Fix language defaults for 2.1 2017-05-30 09:35:06 -04:00
Chuck Atkins
9b112a848a Compilers: Port to use default cmake_record_lang_compile_features macros 2017-05-30 09:34:36 -04:00
Chuck Atkins
37221529c7 MSVC: Add empty definitions for std compile options
There are no specific options for MSVC to set language standards, but
set them as empty strings anyways so the feature test infrastructure
can at least check to see if they are defined.
2017-05-29 13:51:54 -04:00
Chuck Atkins
5bb7429166 Compilers: Add default cmake_record_{c,cxx}_compile_features macros
Add default implementations for the cmake_record_lang_compile_features
macros.  All implementations of this are the same so it can be safely
factored out to a common implementation.
2017-05-29 12:33:42 -04:00
Brad King
d375618921 Merge topic 'sunpro-std-flags'
370d0d25 SunPro: update flags used for CMake itself
f1f21e30 SunPro: set -library=stlport as standard compile option for C++98
9316120c SunPro: add standard compile option for C++03
783fbb77 Tests: Compile entire Plugin test with the same language standard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !879
2017-05-28 09:22:33 -04:00
Daniel Pfeifer
f1f21e3077 SunPro: set -library=stlport as standard compile option for C++98 2017-05-26 13:26:39 -04:00
Daniel Pfeifer
9316120c80 SunPro: add standard compile option for C++03 2017-05-26 13:26:39 -04:00
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