summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* IAR/CXX: Fix compatibility with CMP0057 OLDRaul Tambre2022-01-291-3/+6
| | | | | | | | | | Commit a9073db7 (IAR: update language specification detection, 2021-09-23) added usage of the if() IN_LIST operation and forgot to account for it not being available in CMP0057 OLD mode. Push and temporarily enable the policy. Also avoid the unnecessary temporary variable for the list. Fixes #23147.
* MSVC: Use -external:I flag without space to support Clang toolsBrad King2022-01-112-2/+2
| | | | | | | | | | Since commit f29e1874ad (Compiler/MSVC: use the `-external:I` flag for system includes, 2020-05-19, v3.22.0-rc1~593^2) we use the new flag followed by the include directory as a separate argument. Some versions of `clang-cl` and `clang-tidy` do not support the flag unless the include directory is attached to it, so use that form instead. Fixes: #22979
* Merge topic 'nvhpc-isystem' into release-3.22Brad King2021-11-031-0/+1
|\ | | | | | | | | | | | | 92624714c4 NVHPC: Support SYSTEM include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6691
| * NVHPC: Support SYSTEM include directoriesRobert Maynard2021-11-021-0/+1
| | | | | | | | Fixed #22834
* | MSVC: Add support for C17Brad King2021-10-281-0/+2
| | | | | | | | | | | | C17 support has been available in MSVC since VS 16.8. Fixes: #22816
* | MSVC: Tolerate c_std_17 and c_std_23 features on older compiler versionsBrad King2021-10-281-0/+2
| | | | | | | | | | | | | | MSVC `cl` versions prior to 19.27 had no `-std:c*` flags for C standards. List the `c_std_{17,23}` features anyway. This allows projects to at least attempt compilation with these compilers since they do not have any modes.
* | MSVC: Refactor C compile features table for C90, C99, and C11Brad King2021-10-281-29/+35
|/ | | | | | | | | | | The custom "no modes" `cmake_record_c_compile_features` implementation should only be used in `cl` versions prior to 19.27 because they had no `-std:c*` flags for C standards. For 19.27 we need a different custom implementation to account for partial C11 support. For 19.28 and above we can use the default implementation through the `*__HAS_FULL_SUPPORT` settings. We already use this pattern in the MSVC C++ compile feature table.
* Merge topic 'msvc-c++23' into release-3.22Brad King2021-10-121-0/+1
|\ | | | | | | | | | | | | | | ef47e18ad0 MSVC: Tolerate cxx_std_23 feature on older compiler versions Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !6614
| * MSVC: Tolerate cxx_std_23 feature on older compiler versionsBrad King2021-10-071-0/+1
| | | | | | | | | | | | | | | | | | | | In commit 3aaf1d91bf (MSVC: C++20 final flag, C++23 support, 2021-05-29, v3.20.4~7^2~1) we forgot to add `cxx_std_23` to the fallback table for MSVC versions from VS 2010 through VS 2015. This allows project to at least attempt compilation with these compilers since they do not have any modes. Issue: #22729
| * IntelLLVM: Fix C/C++ standard level flags on WindowsBrad King2021-07-072-12/+4
| | | | | | | | | | | | | | | | | | In commit a90d2a9eed (IntelLLVM: Add support for Intel LLVM-based compilers, 2020-11-02, v3.20.0-rc1~89^2~20) we accidentally left out activation of the C/C++ standard level selection logic when IntelLLVM is targeting the MSVC ABI. Fixes: #22388
* | Merge topic 'corret_nvhpc_fortran_compile_deps'Brad King2021-10-073-12/+21
|\ \ | | | | | | | | | | | | | | | | | | 1a828043b7 NVHPC: only use '-MD' for the C and CXX languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6602
| * | NVHPC: only use '-MD' for the C and CXX languagesRobert Maynard2021-10-063-12/+21
| | | | | | | | | | | | | | | | | | CMake shouldn't use '-MD' for nvfortran to generate dependency information. Fixes #22723
* | | Merge topic 'iar-assembly-S-extension'Brad King2021-10-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 589c6c8e3f IAR: added .S extension for IAR-ASM.cmake Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6585
| * | | IAR: added .S extension for IAR-ASM.cmakeFelipe Torrezan2021-10-021-1/+1
| | | |
* | | | cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logicRaul Tambre2021-09-292-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are part of CMP0128. When the standard level is unset: * Flags are added if extension mode doesn't match the compiler's default. Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224. * The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was used. This was only supported for IAR. Otherwise: * Avoid adding flags if not necessary per the detected compiler defaults. * Fixed check for when the requested standard is older. It now matches the nearby comments. I reworded the fallback comment as its logic was a bit difficult to wrap my head around.
* | | | CompilerID: Compiler extensions default detectionRaul Tambre2021-09-281-6/+12
|/ / /
* | | IAR: update language specification detectionFelipe Torrezan2021-09-234-110/+76
| | |
* | | Merge topic 'iar-asm-deduplication'Brad King2021-09-232-58/+30
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | b1727b8a7e IAR: ASM module code deduplication Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6553
| * | | IAR: ASM module code deduplicationFelipe Torrezan2021-09-232-58/+30
| | | |
* | | | Merge topic 'iar-rl78-xlink'Brad King2021-09-232-4/+12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8954f93543 IAR: emit fatal message for RL78 XLINK Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6552
| * | | | IAR: emit fatal message for RL78 XLINKFelipe Torrezan2021-09-212-4/+12
| |/ / /
* | | | IAR: Use same executable suffix as try_compileRainer Keller2021-09-211-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a mismatch in the executable suffix between the compiler detection and try_compile. This resulted in the generated executable having a different suffix than what try_compile was looking for. The IAR module is changed to use the same suffix as try_compile. Fixes: #22567
* | | Merge topic 'hip-no-hipcc'Brad King2021-09-2010-135/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cb93f72624 HIP: Simplify detection of HIP runtime CMake package a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly b125e9809a HIP: Detect ROCm path earlier 735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Merge-request: !6533
| * | HIP: Simplify detection of HIP runtime CMake packageBrad King2021-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | It only makes sense to use the CMake package from the same ROCm installation that the compiler uses. Ask the HIP compiler to report the location of the ROCm installation. Verify up front that it contains the expected CMake package file.
| * | HIP: Remove ROMClang compiler id and use Clang directlyBrad King2021-09-169-134/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bd844387df (ROCMClang: Add the ROCm toolkit derived clang compiler to CMake, 2020-08-28, v3.21.0-rc1~66^2~6) and commit ff0d2858e1 (HIP: Extract clang compiler details from hipcc, 2020-10-21, v3.21.0-rc1~66^2~5), the separate `ROCMClang` compiler id for `hipcc` has caused a few problems: * The compiler id changed from behavior of CMake 3.20 and below, breaking projects that already built with `hipcc` treated as `Clang`. * The implementation of `target_compile_features` was incomplete for the `ROCMClang` identity. * Only `hipcc` was identified as `ROCMClang`, so after it is unwrapped to the underlying `clang++`, future runs of new CMake versions on an existing build tree would not repeat this. * Clang should be usable as a HIP compiler without the `hipcc` wrapper. Remove the `ROMClang` compiler identity, and revise HIP language support to work directly with a Clang compiler. Reject direct `hipcc` usage as a HIP compiler. For now it cannot be supported because it interferes with flags CMake needs to pass to Clang. Fixes: #22536, #22460, #22593
| * | Merge topic 'binutils-no-cmake-paths' into release-3.21Brad King2021-08-102-0/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | fc1f733cc7 BinUtils: Avoid searching CMAKE_PREFIX_PATH Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6434
* | | | IWYU: Add `--driver-mode=cl` when applicablePigeonF2021-09-108-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | We already do this for `clang-tidy`. Fixes: #16554
* | | | Merge topic 'armclang-compiler-deps'Brad King2021-08-102-0/+16
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7ef5255e1e armclang: activate compiler dependencies generation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6433
| * | | | armclang: activate compiler dependencies generationMarc Chevrier2021-08-062-0/+16
| | | | |
* | | | | Merge topic 'binutils-no-cmake-paths'Brad King2021-08-102-0/+4
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | fc1f733cc7 BinUtils: Avoid searching CMAKE_PREFIX_PATH Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6434
| * | | | BinUtils: Avoid searching CMAKE_PREFIX_PATHCristian Adam2021-08-092-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our `find_program` calls specify `HINTS` to look in the toolchain's directory first, and then in `PATH`. `CMAKE_PREFIX_PATH` may be specified by the user to help find packages for project dependencies, but this should not override the binutils. Fixes: #22512
* | | | | Merge topic 'nvhpc_support_new_c_and_c++_standards'Brad King2021-08-092-0/+10
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | 9ac426e460 NVHPC-C: Add support for C17 f5dbc27c27 NVHPC-CXX: Add support for C++20 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !6430
| * | | NVHPC-C: Add support for C17Robert Maynard2021-08-051-0/+5
| | | |
| * | | NVHPC-CXX: Add support for C++20Robert Maynard2021-08-051-0/+5
| |/ /
* | | Merge topic 'nvhpc-MD-flag'Brad King2021-08-023-10/+12
|\ \ \ | |/ / | | | | | | | | | | | | | | | 7ce718376c NVHPC: Support 21.07 change to '-MD' where it behaves like gcc Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6408
| * | NVHPC: Support 21.07 change to '-MD' where it behaves like gccRobert Maynard2021-07-293-10/+12
| | |
| * | Merge topic 'gnu_c23' into release-3.21Brad King2021-07-231-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | d61bc4241d GNU: Correct C23 flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6376
* | \ \ Merge topic 'gnu_c23'Brad King2021-07-231-2/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | d61bc4241d GNU: Correct C23 flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6376
| * | | GNU: Correct C23 flagsRaul Tambre2021-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-final forms aren't supported yet, unlike C++23. Seems I might've gotten confused due to that when I added these. Fixes #22453.
* | | | Merge topic 'iar-binutils'Brad King2021-07-232-86/+0
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | 5b9bfe738c IAR: Moved search logic to BinUtils. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6372
| * | | IAR: Moved search logic to BinUtils.Jean-Marc Hengen2021-07-232-86/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The search logic for the IAR linker, librarian and related tools is moved from `Modules/Compiler/IAR-FindBinUtils.cmake` to `Modules/CMakeFindBinUtils.cmake` by introducing an new elseif block for the IAR toolchain. The search logic was refactored to omit repeating itself. Fixes: #22425
| * | Merge topic 'iar-exe-suffix' into release-3.21Brad King2021-07-201-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly 05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6357
* | \ \ Merge topic 'iar-exe-suffix'Brad King2021-07-201-2/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly 05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6357
| * | | Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIXLorenzo Cappelletti2021-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use `CMAKE_EXECUTABLE_SUFFIX_<LANG>` instead. Fixes: #22426
* | | | Merge topic 'iar-host-exe'Brad King2021-07-201-8/+24
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | 1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6362
| * | | Compiler/IAR: search for both IAR's binaries * and *.exeLorenzo Cappelletti2021-07-201-8/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | IAR is available for both Linux and Windows OSes. Moreover, binaries `*.exe` could be called from a Linux box, or vice versa. See also commit 01a4eec446 (IAR: Changes required for Linux, 2019-04-25, v3.15.0-rc1~185^2). Fixes: #22312
* | | Merge topic 'armlink_armar_detection'Brad King2021-07-141-11/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | 509ef50a06 ARMClang: Fix regression in check for working compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6346
| * | ARMClang: Fix regression in check for working compilerLingkai Dong2021-07-141-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the compiler to use, `CMakeFindBinUtils.cmake` automatically determines a number of tools including linker (CMAKE_LINKER) and archiver (CMAKE_AR) and stores them in a generated file `CMakeCCompiler.cmake` as non-CACHE entries. The compiler-specific ARMClang.cmake then tries to override CMAKE_LINKER and CMAKE_AR as CACHE entries. Following the introduction of CMP0126, which is set to NEW in the test for a working compiler, setting a CACHE entry does not replace a normal entry of the same name anymore, resulting in a failed test due to wrong linker and archiver. To fix this, set CMAKE_LINKER and CMAKE_AR for ARMClang directly in `CMakeFindBinUtils.cmake` as is done for other compilers. Check for them in `ARMClang.cmake` to safeguard cases when a project explicitly includes `ARMClang.cmake` prior to compiler determination (which some projects do to work around other problems in older CMake versions).
* | | Merge topic 'LWYU-externalization'Brad King2021-07-121-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration 9c5132a586 PGI: Fix "LINKER:" prefix generated separator 8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6306
| * | | PGI: Fix "LINKER:" prefix generated separatorMarc Chevrier2021-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | Fix a typo from commit 66ea1a3795 (LINK_OPTIONS: Add support of "LINKER:" prefix, 2018-04-30, v3.13.0-rc1~437^2).