summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* PIE link options: Update strategy to fix performance regressionMarc Chevrier2018-12-197-37/+11
| | | | Fixes: #18700
* QNX: Compiler and feature detection fixesCristian Adam2018-12-034-0/+8
| | | | | | | | | | | | | | | | | | | Tested compiler detection with the QNX 7.0 list of compiler targets: * gcc_ntoaarch64le * gcc_ntoaarch64le_cxx * gcc_ntoarmv7le * gcc_ntoarmv7le_cxx * gcc_ntox86_cxx * gcc_ntoaarch64le_gpp * gcc_ntox86_64_gpp * gcc_ntoarmv7le_gpp * gcc_ntox86_64_cxx * gcc_ntox86 * gcc_ntox86_gpp * gcc_ntox86_64 This commit fixes some of the problems described in: https://cristianadam.eu/20181202/a-better-qnx-cmake-toolchain-file/
* POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-117-0/+48
| | | | Fixes: #14983, #16561
* POSITION_INDEPENDENT_CODE: Fix erroneous '-fPIE' flag for Sun StudioMarc Chevrier2018-11-083-0/+3
| | | | Fixes: #16311
* Merge topic 'flang-preprocess-source'Brad King2018-10-301-1/+1
|\ | | | | | | | | | | | | 8d782adbce Flang: Fix command-line used to preprocess sources Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2545
| * Flang: Fix command-line used to preprocess sourcesBrad King2018-10-291-1/+1
| | | | | | | | | | | | | | | | Running flang with `-E` now ignores any `-o` option and always prints preprocessed output to stdout. Use shell redirection to place it in a file instead. Fixes: #18497
* | Merge topic 'qccDepfile'Brad King2018-10-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 99728fe27c QNX: Update qcc depfile flags to be compliant with ccache Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2540
| * | QNX: Update qcc depfile flags to be compliant with ccacheMaikel van den Hurk2018-10-291-1/+1
| |/ | | | | | | | | Pass the flags to the preprocessor phase via `-Wp,`. This is accepted both by qcc and ccache.
* | Autogen: Add clang --target= flag to compiler predefines commandBrad King2018-10-051-0/+8
|/ | | | | | | Respect the compiler target value `CMAKE_<LANG>_COMPILER_TARGET` in `CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`. Issue: #18425
* IAR: Abort if compiler version or target architecture is not detectedDaniel Schürmann2018-09-103-0/+14
| | | | | | | | If these are not detected then we cannot support the IAR compiler. Fail early with an explicit message instead of silently proceeding and getting strange errors. Issue: #18333
* Merge topic 'cmake_lang_compiler_predefines'Brad King2018-08-303-3/+21
|\ | | | | | | | | | | | | 83f2d48388 Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2316
| * Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMANDSebastian Holtermann2018-08-283-3/+21
| | | | | | | | | | | | | | | | | | | | | | AUTOMOC used to fail to generate ``moc_predefs.h`` when ``ccache`` was used as a compiler starter by e.g. configuring a project with the environment variable CXX="ccache g++". The reason was that ``CMAKE_<LANG>_COMPILER_ARG1`` wasn't respected in the definition of ``CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`` for various compilers. This is fixed by this patch. Fixes #17275.
* | Cray: Record C++14 compiler mode optionsKelly (KT) Thompson2018-08-241-0/+4
|/ | | | Fixes: #18270
* Merge topic 'nag-fortran-rsp'Brad King2018-08-061-0/+1
|\ | | | | | | | | | | | | 10d6c3a635 NAG: Pass response files through front-end to the linker Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2250
| * NAG: Pass response files through front-end to the linkerBrad King2018-08-011-0/+1
| | | | | | | | | | | | | | The `nagfor` compiler front-end does not support the `@rspfile` syntax. Use `-Wl,@rspfile` instead to pass it through to the linker. Fixes: #18232
* | XL: Use -qpic for position independent executablesBrad King2018-08-011-0/+1
|/ | | | | | The XL compiler does not have a dedicated "pie" option so use at least `-qpic`. This missing setting was exposed by the `ExportImport` and `PositionIndependentTargets` tests with XL on an ELF platform.
* Merge topic 'intel-std-fix'Brad King2018-07-132-8/+10
|\ | | | | | | | | | | | | 735e69f445 Intel: Fix incorrectly documented extension flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2206
| * Intel: Fix incorrectly documented extension flagsChristian Pfeiffer2018-07-122-8/+10
| | | | | | | | Fixes: #18166
* | Merge topic 'qnx_fix'Brad King2018-07-121-0/+2
|\ \ | | | | | | | | | | | | | | | | | | e014df762b QNX: Fix autogen compiler predefines detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2205
| * | QNX: Fix autogen compiler predefines detectionCristian Adam2018-07-111-0/+2
| |/ | | | | | | | | | | In commit v3.12.0-rc1~20^2 (Move GNU COMPILER_PREDEFINES_COMMAND from Platform to Compiler, 2018-06-01), `Compiler/GNU.cmake` introduced the `-dM` flag, which requires `-Wp` prefix for the QNX compiler wrapper.
* | LINK_OPTIONS: Add support of "LINKER:" prefixMarc Chevrier2018-06-0617-0/+45
|/
* Features: Add special case to disable relaxed constexpr for Intel 18Brad King2018-06-041-1/+1
| | | | | | | | | | 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.
* Merge topic 'fix-ti-c-standard'Brad King2018-06-041-0/+6
|\ | | | | | | | | | | | | 9e27881bb1 TI: Add support for C language standards Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2131
| * TI: Add support for C language standardsArnaud Gelas2018-06-041-0/+6
| | | | | | | | | | | | Set C90 and C99 compile options for TI compiler. Fixes: #18061
* | Move GNU COMPILER_PREDEFINES_COMMAND from Platform to CompilerSebastian Holtermann2018-06-011-0/+2
|/ | | | | | | | 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).
* CUDA: Add compiler detection for CUDA < 7.5Henry Schreiner2018-04-231-3/+5
| | | | | | | If the CUDA version macros are not defined, run `nvcc --version` and extract the version from its output. Fixes: #17920
* SunPro,XL: Add depfile flags to support Ninja generatorEphi Sinowitz2018-04-173-0/+6
| | | | | Add CMAKE_DEPFILE_FLAGS_${lang} to SunPro and XL. These flags are used by the Ninja generator.
* Merge topic 'clang-cl-std'Brad King2018-04-131-5/+42
|\ | | | | | | | | | | | | | | | | 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
| * Clang: Add standard flags support when simulating MSVCRuben Van Boxem2018-04-111-0/+21
| | | | | | | | | | | | | | When Clang 3.9 simulates MSVC 19.0 or higher it knows the `-std:` flags that such versions of MSVC defines. Fixes: #17866
| * Clang: Avoid extra C++ feature detection when simulating MSVCBrad King2018-04-111-0/+15
| | | | | | | | | | | | | | | | 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
| * Clang: Refactor standard flags logic when simulating MSVCBrad King2018-04-111-5/+6
| | | | | | | | | | Consolidate the compile options and standard defaults branches. Add comments.
* | Merge topic 'features-msvc-2017'Brad King2018-04-121-21/+15
|\ \ | |/ |/| | | | | | | | | 5f4272cc06 Features: Record for VS 2017 through 15.6 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1903
| * Features: Record for VS 2017 through 15.6Daniel Filipe2018-04-111-21/+15
| | | | | | | | | | | | | | 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.
* | Android: Do not pass non-existent Clang -std flagsBrad King2018-04-021-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge topic 'features-c++20'Brad King2018-04-024-2/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Features: Activate C++ 20 support for Clang 5.0+Brad King2018-03-271-0/+5
| | |
| * | Features: Activate C++ 20 support for GNU 8.0+Brad King2018-03-271-0/+5
| | |
| * | Features: Activate C++ 20 support for MSVC 19.12.25835+Brad King2018-03-271-0/+4
| | |
| * | Features: Add infrastructure for C++ 20 language standardBrad King2018-03-273-0/+14
| | | | | | | | | | | | Issue: #17849
| * | Features: Use -std=c++17 for C++ 17 on Clang 5.0+Brad King2018-03-261-1/+4
| | | | | | | | | | | | Clang 5.0 added support for the `-std=c++17` flag.
| * | Features: Use -std=c++17 for C++ 17 on GNU 8.0+Brad King2018-03-261-1/+4
| |/ | | | | | | GNU 8 now documents official support for the `-std=c++17` flag.
* | Features: Record C features for MSVCBrad King2018-03-292-0/+33
|/ | | | | | | | | 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
* Features: Record for SunPro 5.15Brad King2018-03-201-1/+5
| | | | Oracle Developer Studio 12.6 adds support for more C++ 11 features.
* Features: Record initializer list support for Intel 14 and aboveBrad King2018-03-161-5/+1
| | | | | | | | | | | | | | | 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
* Merge branch 'cuda-no-device-link-rsp' into release-3.11Brad King2018-03-071-0/+6
|\ | | | | | | Merge-request: !1831
| * CUDA: Do not pass unsupported @rspfile arguments to NVCCBrad King2018-03-071-0/+6
| | | | | | | | | | | | | | The nvcc compiler does not support `@<rspfile>` arguments. It does offer a `--options-file` argument that can be investigated later. Fixes: #17797
* | XL: Recognize compilers identified by __ibmxl__Brad King2018-03-064-10/+26
|/ | | | | | | | | 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
* Compiler/TI: Fix depfile generation for C++Grzegorz Dobinski2018-02-201-1/+1
| | | | | | | | 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
* Merge topic 'intel-cxx17-flags'Brad King2018-01-292-1/+13
|\ | | | | | | | | | | | | | | c3d576f5 Intel: Add C++17 compiler options 4a5727d3 Intel: Correct the C11 ext flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1711
| * Intel: Add C++17 compiler optionsChristian Pfeiffer2018-01-271-0/+11
| | | | | | | | | | | | | | 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