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
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.
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.
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
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.
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++.
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.
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
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
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.
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.
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 |
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
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.
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.
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