Commit Graph

898 Commits

Author SHA1 Message Date
Brad King
617b8df7cf Merge topic 'clang-16-cxx-modules'
3fe8e33f27 Clang: Record Clang 16.0 flags for our experimental C++ modules support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8285
2023-03-06 08:59:21 -05:00
Brad King
3fe8e33f27 Clang: Record Clang 16.0 flags for our experimental C++ modules support
LLVM/Clang 16.0 now contains official support for what CMake needs.
2023-03-03 12:44:53 -05:00
Joakim Lönnberg
3b365c461f IAR: Tolerate variables named for languages
If a project or user sets a variable or cache entry named `C` or `CXX`,
we were previously comparing those language names to the value of that
variable, rather than the name itself.  Double-quote the string to take
advantage of policy `CMP0054`, but also add "x" prefixes to support
projects that do not set the policy.

This extends a similar fix from commit c8eb357738 (CompilerId: Tolerate
variables named for languages, 2021-06-17, v3.21.0-rc1~9^2).
2023-02-21 09:24:14 -05:00
makise-homura
9f9d121ddb LCC: Disable Fortran preprocessor testing if unsupported
LCC < 1.24 has no way to disable integrated Fortran preprocessor,
and it can't produce preprocessed files explicitly. So we
disable all functionality (and therefore tests) related to it.
2023-02-16 03:55:31 +03:00
David Truby
3f1e58c5b9 LLVMFlang: Fix post-preprocess compile for fixed-form Fortran
LLVM Flang's preprocessor output is always valid fixed form Fortran with
a fixed line length of 72. If an application tries to use fixed form
with a different line length, this will fail in the
post-preprocessing compilation step as they will pass a flag asking for
a different fixed line length.

To fix this we can pass -ffixed-line-length-72 to the post-preprocess
compilation stage. This will be ignored when the input is free form
Fortran, and force to a 72 line length when the input is fixed.
2023-02-14 09:22:12 -05:00
Brad King
2a75edb342 LCC: Fix extraction of __LCC__ version components
Previously the logic only worked for major versions of the form `1.xx`.
Fix it to work with versions `2.xx` and above.
2023-02-13 09:29:32 -05:00
Brad King
5d40cf45fa Merge topic 'android-ndk-legacy-toolchain' into release-3.26
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
2023-02-07 09:32:19 -05:00
Brad King
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
This variable has been provided since commit 746906242d (Android: Detect
NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's
NDK support or the modern NDK toolchain file.  Since commit 005e2cdfb0
(Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2)
we need the value in our compiler/platform information files, so provide
it when using the NDK legacy toolchain file too.

Revert commit 1c86e397fe (Android/Clang: Tolerate undefined
CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the
variable should now always be defined.

Issue: #21772
Fixes: #24386
2023-02-06 17:17:25 -05:00
Brad King
f6ed2585e5 Modules: Record system inspection steps in the configure log
Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging
with calls to `message(CONFIGURE_LOG)` to record the steps in the
`CMakeConfigureLog.yaml` configure log instead.

Issue: #23200
2023-01-18 17:59:10 -05:00
scivision
4331f7b4bf IntelLLVM: Add provisional flags for C23 and C++23 2023-01-16 15:08:34 -05:00
scivision
42ca6416af IntelLLVM: Replace -Qstd= with -Qstd: on Windows
The latter is the documented form [1].

[1] https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/language-options/std-qstd.html
2023-01-16 15:08:34 -05:00
Brad King
1efb3c5870 Merge topic 'IntelLLVM-msvc-no-cxx11'
88f9fdcb03 IntelLLVM: Avoid unnecessary -Qstd=c++11 flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8069
2023-01-13 08:43:30 -05:00
Brad King
88f9fdcb03 IntelLLVM: Avoid unnecessary -Qstd=c++11 flag on Windows
The IntelLLVM compiler, for compatibility with MSVC on Windows, always
runs with support for at least C++14.  The `-Qstd=c++11` flag just
causes a warning that it is unused.

Fixes: #24316
2023-01-12 15:58:14 -05:00
Brad King
29c4690e0a Merge topic 'cuda-nvcc-cuda20'
0aeeb8160c CUDA: Add support for cuda_std_20 for nvcc 12.0+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8008
2022-12-14 08:58:55 -05:00
Robert Maynard
0aeeb8160c CUDA: Add support for cuda_std_20 for nvcc 12.0+
CUDA 12.0 has been released with support for `-std=c++20`.
2022-12-13 10:18:15 -05:00
Ben Boeckel
51093f3002 Clang-FindBinUtils: also find clang-scan-deps
`clang-scan-deps` will be required for C++20 module scanning purposes.
2022-12-02 13:04:34 -05:00
Brad King
be9d93ecef Merge topic 'iar-rsp-on-objects'
a51e01f2ec IAR: Add response flag for files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7957
2022-11-29 10:33:50 -05:00
Brad King
a7a7a76e02 Merge topic 'msvc-cxx-no-optin-experimental-flag'
12e4bc73cb MSVC: don't opt into dyndep support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7965
2022-11-29 10:22:48 -05:00
Ben Boeckel
12e4bc73cb MSVC: don't opt into dyndep support
Instead, just set the variables for how scanning works since that is
part of the compiler mechanisms.

Fixes: #24198
2022-11-28 18:02:51 -05:00
Felipe Torrezan
a51e01f2ec IAR: Add response flag for files 2022-11-27 12:14:45 +01:00
Joerg Bornemann
d538cb0e18 Only initialize CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
Don't initialize the other CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
variables.

The only language variant that is used is
CMAKE_CXX_COMPILER_PREDEFINES_COMMAND, and the other language variants
contained invalid, namely C++-specific commands.

Fixes: #23968
2022-11-16 13:08:31 +01:00
Brad King
7a4673965f Merge topic 'nvcc-isystem'
207fd956d8 CUDA: Use consistent -isystem flag style for NVIDIA nvcc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7904
2022-11-14 10:32:32 -05:00
Ben Boeckel
0e9782b336 msvc: bless MSVC 19.34 support for C++ modules as experimental
Visual Studio 17.4 now contains official support for what CMake needs.
2022-11-11 16:54:05 -05:00
YantaoZhao
207fd956d8 CUDA: Use consistent -isystem flag style for NVIDIA nvcc
Replace `-isystem=` with `-isystem ` for consistency with other compilers.

Fixes: #24154
2022-11-11 12:19:41 -05:00
Christoph Seitz
0a1d558971 Tasking: Remove CMAKE_SYSTEM_PROCESSOR support per CMP0123
Architecture specific compile options should be set through
toolchain files.

Fixes: #24115
2022-11-07 09:22:02 -05:00
Gordon Jess
7e612977b9 Tasking: Fix PIC option for Tasking Toolset
Fixes: #24114
2022-11-03 08:57:20 -04:00
Daniel Schürmann
73e84a392b IAR: Restore support for CMAKE_CXX_FLAGS_INIT
Prior to commit a9073db736 (IAR: update language specification
detection, 2021-09-23, v3.22.0-rc1~83^2) the `--c++`/`--eec++` flags
were stored in `CMAKE_IAR_CXX_FLAG` so that they would be used as part
of the `CMAKE_CXX_COMPILE_OBJECT` rule variable.  That commit moved the
flags to `CMAKE_CXX_FLAGS`, which also broke initialization of
`CMAKE_CXX_FLAGS` from `CMAKE_CXX_FLAGS_INIT`.  Restore the original
approach.

Fixes: #24111
2022-11-01 14:59:24 -04:00
Brad King
f3bb1c8d7f Merge topic 'flang-implicit-link-info' into release-3.25
0301779e85 LLVMFlang: Add support for mixed-language linking with Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7781
2022-10-12 09:17:47 -04:00
Brad King
0301779e85 LLVMFlang: Add support for mixed-language linking with Fortran
Parse implicit link information for this compiler to support
mixed-language linking.  This was missed by commit 85749766df
(LLVMFlang: Add support for LLVM Flang, 2021-07-07, v3.24.0-rc1~86^2).
Also activate mixed-language test cases that would have caught this.

Issue: #22387
2022-10-11 15:38:48 -04:00
Brad King
eebbe36ae6 Merge topic 'Intel-Fortran-warn-errors'
13f3382b1c Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag
ab8a0a106e COMPILE_WARNING_AS_ERROR: Fix internal formatting of options table

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7758
2022-10-10 09:49:46 -04:00
Michael Hirsch
13f3382b1c Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag
Update the compiler options table added by commit 76a08cd253
(COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors,
2022-04-21, v3.24.0-rc1~173^2) to use the Intel Fortran compilers'
dedicated `-warn*` flags.
2022-10-07 10:05:49 -04:00
Brad King
ab8a0a106e COMPILE_WARNING_AS_ERROR: Fix internal formatting of options table
In commit 76a08cd253 (COMPILE_WARNING_AS_ERROR: Add options to treat
warnings as errors, 2022-04-21, v3.24.0-rc1~173^2) we formatted the
options table entries as command-line string fragments.  Since they are
part of the `CMAKE_${lang}_COMPILE_OPTIONS_*` tables, they should be
formatted as `;`-separated lists of compiler options.
2022-10-07 10:05:21 -04:00
Hutchings Samuel (ETAS/ERS-PRM)
5b03fecb8f Tasking: Simplify processor list matching regex 2022-10-07 12:04:13 +01:00
Boris Egorov
1c86e397fe Android/Clang: Tolerate undefined CMAKE_ANDROID_NDK_VERSION
The previous fix for #21772, commit 005e2cdfb0 (Android: Do not use gold
for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2), doesn't work with typical
android toolchain file, like this one:

    https://android.googlesource.com/platform/ndk/+/master/build/cmake/android-legacy.toolchain.cmake

The condition fails to work when CMAKE_ANDROID_NDK_VERSION is undefined:
second part evaluates to true, although ndk version is not known.

I've encountered following environment where CMAKE_ANDROID_NDK_VERSION
is used without definition:

* Build uses android toolchain file, which sets CMAKE_SYSTEM_VERSION=1
  and doesn't set CMAKE_ANDROID_NDK_VERSION.
* Code in Platform/Android-Determine.cmake exits early when it detects
  toolchain usage (via value CMAKE_SYSTEM_VERSION=1). This file is the
  only place in cmake modules where variable CMAKE_ANDROID_NDK_VERSION
  is set, and by early return we skip this definition.
2022-09-16 10:36:58 -04:00
Christoph Seitz
94df5b6ef1 Tasking: Add support for several compiler toolsets
Add support for the Tasking compiler toolset:

* TriCore Compiler Toolset 6.3 (with TriCore, ARM, MCS,
  8051 and PCP architecture compilers)
* SmartCode Compiler Toolset 10.1 (with TriCore, ARC, MCS,
  8051 architecture compilers)
* ARM Compiler 6.0
* MCS Complier 3.3
* 8051 Compiler 7.2

Fixes: #23756
2022-09-14 09:58:50 -04:00
Robert Maynard
f808d8afb9 CMake: Support upcoming C++26 language level 2022-08-31 13:46:18 -04:00
Brad King
c5f6d93d5e Merge topic 'warning-as-error-ti-compiler'
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !7560
2022-08-15 10:51:45 -04:00
Brad King
732cad4952 Merge topic 'warning-as-error-ti-compiler' into release-3.24
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !7560
2022-08-15 10:51:44 -04:00
Brad King
d0a307ddcf Merge topic 'mingw-flto'
7b2a87c2eb IPO: Do not use -flto=auto with GCC 10.x on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7559
2022-08-15 10:48:27 -04:00
Craig Scott
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property 2022-08-12 08:27:19 +10:00
Brad King
7b2a87c2eb IPO: Do not use -flto=auto with GCC 10.x on Windows
Revise the change from commit fe57410b33 (IPO: Use -flto=auto if
compiler is GCC >= 10.1, 2022-06-22, v3.24.0-rc2~2^2) to require
at least GCC 11 on Windows.

Fixes: #23836
Issue: #23640
2022-08-10 14:49:34 -04:00
Brad King
52dec3f11f Merge topic 'enable-intel-llvm-ipo-3'
c633bd76d8 Add linker prefix for "-stack" flag on MSVC builds
6823db0c5a Enable IPO for IntelLLVM compilers on Linux and Windows
adbffd204d Propagate OpenMP compiler flags to linker for IntelLLVM
3640842df2 Tests: Update ModuleDefinition for IntelLLVM MSVC Frontend Variant
5d5a712303 IntelLLVM: Pass linker flags to the compiler when used as linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7533
2022-08-04 09:37:47 -04:00
William R. Dieter
6823db0c5a Enable IPO for IntelLLVM compilers on Linux and Windows
Replicate and adapt Linux IPO options for Intel for IntelLLVM compilers
on Linux and Windows.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-08-01 19:34:49 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Brad King
aa1eaf6b8a Merge topic 'nvhpc-Werror'
35ec676ace NVHPC: warnings as error flag is "-Werror"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7415
2022-07-05 10:32:55 -04:00
Brad King
d5772027c2 Merge topic 'add_nvcc_compile_warning_support'
cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property
2e9ac1d272 Tests: Refactor warn on error tests to support multiple languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7417
2022-07-05 10:31:23 -04:00
Robert Maynard
35ec676ace NVHPC: warnings as error flag is "-Werror" 2022-07-01 08:05:19 -04:00
Robert Maynard
cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property 2022-07-01 08:04:54 -04:00
Brad King
4137cf1964 Merge topic 'ipo_append_auto_on_gcc'
fe57410b33 IPO: Use -flto=auto if compiler is GCC >= 10.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7400
2022-06-23 09:24:59 -04:00
Linus Dierheimer
fe57410b33 IPO: Use -flto=auto if compiler is GCC >= 10.1
Since GCC 12.1, the `-flto` option warns unless given an explicit
LTRANS job count.

Issue: #23640
2022-06-22 09:09:16 -04:00