Commit Graph

846 Commits

Author SHA1 Message Date
Martin Duffy
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors
Add `COMPILE_WARNING_AS_ERROR` target property and supporting
`CMAKE_COMPILE_WARNING_AS_ERROR` variable.

`COMPILE_WARNING_AS_ERROR` is initialized by
`CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is
true, it expands to a different flag depending on the compiler such that
any warnings at compile will be treated as errors.

Supports compiler ids that I could find a relevant flag for.
2022-05-06 12:14:37 -04:00
Chris Wright
87142bbd5f ADSP: Add dedicated platform module 2022-04-04 17:05:09 +01:00
Chris Wright
e9eabb0dcd ADSP: Configure compiler in compiler module 2022-04-04 16:56:47 +01:00
Chris Wright
88b38f531a ADSP: Support both VDSP++ and CCES for ADSP compilers 2022-04-04 16:56:47 +01:00
Brad King
37f7d0d295 Merge topic 'AppleClang-cxx20-cxx23-flags'
683e4e9cab AppleClang: Add C++20 and C++23 flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7063
2022-03-15 12:46:33 -04:00
Ken Matsui
683e4e9cab AppleClang: Add C++20 and C++23 flags
Follow up commit 886e27062b (Clang/MSVC: C++20 final flag, C++23
support, 2021-05-29, v3.20.4~7^2) with support for AppleClang.
2022-03-11 10:00:21 -05:00
Brad King
51e81d1f73 Merge topic 'color-diagnostics'
6ab9fbd43b color: Add tests for CMAKE_COLOR_DIAGNOSTICS
78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable
884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Frank Dana <ferdnyc@gmail.com>
Merge-request: !6990
2022-03-09 12:15:53 -05:00
Brad King
a7474dac87 Merge topic 'iar-cmp0057'
bd3e23a605 IAR: Fix detection of modern C++ version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7053
2022-03-09 12:09:03 -05:00
Semyon Kolton
884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable
Add a variable to control both makefile color messages and compiler
color diagnostics.

Fixes: #15502
2022-03-08 16:37:08 -05:00
Kenneth Soerensen
bd3e23a605 IAR: Fix detection of modern C++ version
The change in commit cc4da8d13a (IAR/CXX: Fix compatibility with CMP0057
OLD, 2022-01-29, v3.23.0-rc1~46^2) broke the detection of C++ version
because the `IN_LIST` operator cannot work directly on a list but
requires a variable.
2022-03-08 09:34:48 -05:00
Marc Chevrier
93a153bc7f Genx-LINK_LIBRARY: simplify framework features definitions 2022-03-04 16:51:53 +01:00
Marc Chevrier
a9928eb4a5 SunPro C: ensure LINKER: prefix is usable for all versions 2022-02-27 13:46:49 +01:00
Marc Chevrier
397ee55cd6 genex-LINK_LIBRARY: rename configuration variables
To be more consistent between genex and variables as well as
the forecomming LINK_GROUP genex, rename variable *_LINK_USING_<FEATURE>*
in *_LINK_LIBRARY_USING_<FEATURE>*
2022-02-16 18:34:28 +01:00
Marc Chevrier
a2cfa2da4f GenEx/LINK_LIBRARY: Add features for framework support on Apple 2022-02-15 10:53:33 +01:00
Brad King
8035784967 Merge topic 'iar_cmp0057'
cc4da8d13a IAR/CXX: Fix compatibility with CMP0057 OLD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6921
2022-01-31 10:31:31 -05:00
Raul Tambre
cc4da8d13a IAR/CXX: Fix compatibility with CMP0057 OLD
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.
2022-01-29 22:55:24 +02:00
Aaron Liu
6da99e671c IBMClang: Add support for IBM Open XL C/C++
Fixes: #22929
2022-01-27 09:38:01 -05:00
Brad King
c0f0fe50bf Merge topic 'msvc-isystem'
3a8b6653dc MSVC: Use -external:I flag without space to support Clang tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6855
2022-01-12 09:51:32 -05:00
Brad King
3a8b6653dc MSVC: Use -external:I flag without space to support Clang tools
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
2022-01-11 16:36:36 -05:00
Raul Tambre
4707ecbe6f CUDA: Support CMP0105 on Clang
Add link flags during the "device compile" step.

Enabled the relevant tests. The disable reasons regarding separable compilation
were outdated and the actual failure case was device link flags support.
2021-11-08 21:26:00 +02:00
Brad King
98f0ee645f Merge topic 'nvhpc-isystem'
92624714c4 NVHPC: Support SYSTEM include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6691
2021-11-03 10:37:55 -04:00
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
3026d8468b Merge topic 'msvc-c17'
c5cc4ddac4 MSVC: Add support for C17
6561b032bc MSVC: Tolerate c_std_17 and c_std_23 features on older compiler versions
22f804e0ec MSVC: Refactor C compile features table for C90, C99, and C11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6677
2021-10-29 08:52: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
ca3e83250f Merge topic 'lcc-policy'
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6643
2021-10-22 07:08:58 -04:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Robert Maynard
61b9764b03 CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATION
The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION`
now aren't mutually exclusive and can now be used together on the same
target.
2021-10-20 11:18:06 -04:00
Brad King
d723bac01c Merge topic 'lcc-compiler'
02b2607a5c Help: Add release note for MCST LCC compiler support
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found
ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6608
2021-10-19 09:22:22 -04:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Brad King
568a93d08c Merge branch 'msvc-c++23' into release-3.21
Merge-request: !6614
2021-10-12 09:35:56 -04:00
Brad King
0ee59ceb3f Merge topic 'msvc-c++23'
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:17 -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