Commit Graph

817 Commits

Author SHA1 Message Date
Brad King
28d63320f1 Merge topic 'nvhpc-isystem' into release-3.22
92624714c4 NVHPC: Support SYSTEM include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6691
2021-11-03 10:37:54 -04:00
Robert Maynard
92624714c4 NVHPC: Support SYSTEM include directories
Fixed #22834
2021-11-02 14:33:18 -04:00
Brad King
c5cc4ddac4 MSVC: Add support for C17
C17 support has been available in MSVC since VS 16.8.

Fixes: #22816
2021-10-28 12:27:00 -04:00
Brad King
6561b032bc MSVC: Tolerate c_std_17 and c_std_23 features on older compiler versions
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.
2021-10-28 12:27:00 -04:00
Brad King
22f804e0ec MSVC: Refactor C compile features table for C90, C99, and C11
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.
2021-10-28 12:27:00 -04:00
Brad King
323846afc1 Merge topic 'msvc-c++23' into release-3.22
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
2021-10-12 09:34:16 -04:00
Brad King
ef47e18ad0 MSVC: Tolerate cxx_std_23 feature on older compiler versions
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
2021-10-07 11:46:09 -04:00
Brad King
0a863c71d8 Merge topic 'corret_nvhpc_fortran_compile_deps'
1a828043b7 NVHPC: only use '-MD' for the C and CXX languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6602
2021-10-07 09:11:21 -04:00
Robert Maynard
1a828043b7 NVHPC: only use '-MD' for the C and CXX languages
CMake shouldn't use '-MD' for nvfortran to generate dependency information.

Fixes #22723
2021-10-06 16:21:29 -04:00
Brad King
f66ad94935 Merge topic 'iar-assembly-S-extension'
589c6c8e3f IAR: added .S extension for IAR-ASM.cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6585
2021-10-05 09:05:53 -04:00
Felipe Torrezan
589c6c8e3f IAR: added .S extension for IAR-ASM.cmake 2021-10-02 21:35:18 +02:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
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.
2021-09-29 22:28:40 +03:00
Raul Tambre
fc3a1cbdd8 CompilerID: Compiler extensions default detection 2021-09-28 21:24:53 +03:00
Felipe Torrezan
a9073db736 IAR: update language specification detection 2021-09-23 22:09:57 +02:00
Brad King
c5b91304ed Merge topic 'iar-asm-deduplication'
b1727b8a7e IAR: ASM module code deduplication

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6553
2021-09-23 10:36:27 -04:00
Felipe Torrezan
b1727b8a7e IAR: ASM module code deduplication 2021-09-23 10:35:06 -04:00
Brad King
2452067fb2 Merge topic 'iar-rl78-xlink'
8954f93543 IAR: emit fatal message for RL78 XLINK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6552
2021-09-23 10:31:25 -04:00
Felipe Torrezan
8954f93543 IAR: emit fatal message for RL78 XLINK 2021-09-21 14:34:16 +02:00
Rainer Keller
9254e7ddf2 IAR: Use same executable suffix as try_compile
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
2021-09-21 07:54:26 +02:00
Brad King
36966f63ca Merge topic 'hip-no-hipcc'
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
2021-09-20 12:38:44 -04:00
Brad King
cb93f72624 HIP: Simplify detection of HIP runtime CMake package
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.
2021-09-16 15:33:53 -04:00
Brad King
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
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
2021-09-16 15:33:47 -04:00
PigeonF
ccfe1b0b40 IWYU: Add --driver-mode=cl when applicable
We already do this for `clang-tidy`.

Fixes: #16554
2021-09-10 09:53:31 -04:00
Brad King
82828401b0 Merge topic 'armclang-compiler-deps'
7ef5255e1e armclang: activate compiler dependencies generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6433
2021-08-10 09:27:29 -04:00
Brad King
81aef41569 Merge topic 'binutils-no-cmake-paths' into release-3.21
fc1f733cc7 BinUtils: Avoid searching CMAKE_PREFIX_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6434
2021-08-10 09:22:52 -04:00
Brad King
25b6cf4f35 Merge topic 'binutils-no-cmake-paths'
fc1f733cc7 BinUtils: Avoid searching CMAKE_PREFIX_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6434
2021-08-10 09:22:52 -04:00
Cristian Adam
fc1f733cc7 BinUtils: Avoid searching CMAKE_PREFIX_PATH
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
2021-08-09 09:59:29 -04:00
Brad King
bd74ac95f1 Merge topic 'nvhpc_support_new_c_and_c++_standards'
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
2021-08-09 09:36:58 -04:00
Marc Chevrier
7ef5255e1e armclang: activate compiler dependencies generation 2021-08-06 14:01:02 +02:00
Robert Maynard
9ac426e460 NVHPC-C: Add support for C17 2021-08-05 16:19:23 -04:00
Robert Maynard
f5dbc27c27 NVHPC-CXX: Add support for C++20 2021-08-05 16:19:12 -04:00
Brad King
b65378878b Merge topic 'nvhpc-MD-flag'
7ce718376c NVHPC: Support 21.07 change to '-MD' where it behaves like gcc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6408
2021-08-02 14:05:34 -04:00
Robert Maynard
7ce718376c NVHPC: Support 21.07 change to '-MD' where it behaves like gcc 2021-07-29 10:43:54 -04:00
Brad King
c8f13bcb41 Merge topic 'gnu_c23' into release-3.21
d61bc4241d GNU: Correct C23 flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6376
2021-07-23 09:40:35 -04:00
Brad King
bd00c0e819 Merge topic 'gnu_c23'
d61bc4241d GNU: Correct C23 flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6376
2021-07-23 09:40:35 -04:00
Brad King
76fa10133d Merge topic 'iar-binutils'
5b9bfe738c IAR: Moved search logic to BinUtils.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6372
2021-07-23 09:27:28 -04:00
Jean-Marc Hengen
5b9bfe738c IAR: Moved search logic to BinUtils.
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
2021-07-23 14:34:26 +02:00
Raul Tambre
d61bc4241d GNU: Correct C23 flags
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.
2021-07-21 20:25:02 +03:00
Brad King
31ecd37180 Merge topic 'iar-exe-suffix' into release-3.21
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
2021-07-20 11:56:01 -04:00
Brad King
f7d82cb6f7 Merge topic 'iar-exe-suffix'
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
2021-07-20 11:56:01 -04:00
Brad King
0a63927b6d Merge topic 'iar-host-exe'
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6362
2021-07-20 11:55:05 -04:00
Lorenzo Cappelletti
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX
Use `CMAKE_EXECUTABLE_SUFFIX_<LANG>` instead.

Fixes: #22426
2021-07-20 11:51:19 -04:00
Lorenzo Cappelletti
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe
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
2021-07-20 11:50:09 -04:00
Brad King
f166d32576 Merge topic 'armlink_armar_detection'
509ef50a06 ARMClang: Fix regression in check for working compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6346
2021-07-14 10:06:29 -04:00
Lingkai Dong
509ef50a06 ARMClang: Fix regression in check for working compiler
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).
2021-07-14 09:45:09 -04:00
Brad King
c9cd039e5f Merge topic 'LWYU-externalization'
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
2021-07-12 08:43:32 -04:00
Marc Chevrier
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
Fix a typo from commit 66ea1a3795 (LINK_OPTIONS: Add support of "LINKER:" prefix,
2018-04-30, v3.13.0-rc1~437^2).
2021-07-09 14:49:01 +02:00
Brad King
1ec39e9bd6 Merge topic 'iar-linker-placeholder'
bf810c75ac IAR: Use placeholders in linker and archiver rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6322
2021-07-08 09:32:41 -04:00
Jean-Marc Hengen
bf810c75ac IAR: Use placeholders in linker and archiver rules
Update the IAR linker and archiver rules to use the `<CMAKE_LINKER>`
and `<CMAKE_AR>` placeholders instead of hard-coding the tool names.

Fixes: #22395
2021-07-08 08:08:52 -04:00
Brad King
7b942e5068 Merge topic 'intel-oneapi-std-windows'
13961f3b43 Merge branch 'backport-3.20-intel-oneapi-std-windows'
5115dd1e2c IntelLLVM: Fix C/C++ standard level flags on Windows
84036d30d4 IntelLLVM: Fix C/C++ standard level flags on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6319
2021-07-08 07:36:57 -04:00