Commit Graph

1062 Commits

Author SHA1 Message Date
Brad King
808ada63cb Merge topic 'diab-compiler-support'
8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10276
2025-02-14 09:35:26 -05:00
Sanjiv Gupta
8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain
Teach CMake to recognize Diab versions 5.9.x.x and above.

Closes: #26666
2025-02-13 10:15:00 -05:00
Josef Angstenberger
83ce71dd38 Tasking: Enable WHOLE_ARCHIVE link feature
Issue: #26426
2025-02-06 10:55:31 -05:00
Josef Angstenberger
1241c7dbcf Tasking: Set response file flag
If not explicitly set to `-f `, the default `@` is used,
which is not supported by Tasking.

Issue: #26426
2025-02-06 10:55:31 -05:00
Josef Angstenberger
754210a3f6 Tasking: Set object extension to .o
The extension `.o` is used by the compiler itself,
and is the only one found in its documentation.

Issue: #26426
2025-02-06 10:55:31 -05:00
Marc Chevrier
0ba67171d9 Extend CMAKE_<LANG>_LINK_MODE support
* Add CMAKE_Swift_LINK_MODE
* Ensure correct definition for various clang usages on Windows
2025-01-26 14:45:21 +01:00
Brad King
1d4d4362d9 Merge topic 'remove-old-compatibility'
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
2025-01-23 09:36:59 -05:00
Brad King
c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Brad King
9a3ecf15ab Merge topic 'tasking-std-flags'
c0972d2c81 Tasking: Drop extensions from C and CXX standard level flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !10208
2025-01-22 09:26:21 -05:00
Alaa Mahran
c0972d2c81 Tasking: Drop extensions from C and CXX standard level flags
Tasking compiler extensions and language standard flags are not tied
together as they are with gcc/clang.  Since CMake does not model
granular abstractions for extensions, leave individual extension flags
to the project or user.

Fixes: #26591
2025-01-21 09:59:05 -05:00
Marc Chevrier
53de9d0125 Introduce CMAKE_<LANG>_DEVICE_LINK_MODE variable.
This is a complement to commit 00932ea864 (Introduce CMAKE_<LANG>_LINK_MODE variable., 2025-01-09)
2025-01-21 15:17:05 +01:00
Brad King
50eebed6ed Merge topic 'tasking-asm'
fc163f9e43 Tasking: Add support for ASM through the cctc compiler driver
942f0d119b Tasking: Add identification for the tasking assembler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10163
2025-01-20 10:03:00 -05:00
Brad King
796cf2d8eb CMP0025: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Alaa Mahran
fc163f9e43 Tasking: Add support for ASM through the cctc compiler driver
The Tasking ASM information module was added by commit 94df5b6ef1
(Tasking: Add support for several compiler toolsets, 2022-07-20,
v3.25.0-rc1~133^2).  However, it appears to have been left from pattern
following and did not actually work with the Tasking assembler.
Update it to work when running the assembler through the compiler
driver `cctc`, which supports extensions `.asm` and `.src`.

Fixes: #26425
2025-01-17 14:44:01 -05:00
Brad King
2245af3ab0 Merge topic 'clang-cuda-link-flags'
ae7f54e6a7 Clang/CUDA: Fix language-wide flags when linking .so with compiler driver

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: DavidRV00 <david@davidv.xyz>
Merge-request: !10173
2025-01-15 09:34:54 -05:00
Brad King
ae7f54e6a7 Clang/CUDA: Fix language-wide flags when linking .so with compiler driver
In commit cfa888a6e2 (Clang/CUDA: Add language-wide flags when linking
with compiler driver, 2024-10-07, v3.31.0-rc1~12^2) we added the wrong
placeholder to `CMAKE_CUDA_CREATE_SHARED_LIBRARY` to represent the
language-wide flags.  The `<FLAGS>` placeholder is for executables.
The `<LANGUAGE_COMPILE_FLAGS>` placeholder is for shared libraries.
The distinction is for historical reasons.

Fixes: #26563
2025-01-14 13:20:43 -05:00
Brad King
72e27a4856 Merge topic 'fix-typos-found-by-pre-commit-hooks'
d620d77d26 FindDoxygen: Rename `_Doxygen_dne_header` -> `_Doxygen_do_not_edit_header`
e7ff3cccea PushToAndroidDevice.cmake: Rename `cmake_parse_arguments` prefix
bc8621d999 Fix: A lot of typos in code found by `typos`
b33beb7af5 Help: Fix some typos found by `sphinx-lint`
78e45c2db6 Style: Replace TABs with spaces for indentation in some files
74e0173f66 Tests(NuGet): Fix the test to ignore empty and space-only lines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10151
2025-01-14 09:44:34 -05:00
Brad King
6a800f666f Merge topic 'CMAKE_LANG_LINK_MODE-variable-creation'
00932ea864 Introduce CMAKE_<LANG>_LINK_MODE variable.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !10162
2025-01-13 11:23:32 -05:00
Alex Turbov
bc8621d999 Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Brad King
02b7250712 Merge topic 'lfortran-generate-object-code'
daf6cc89ee LFortran: Remove hard-coded --generate-object-code flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10159
2025-01-10 09:26:58 -05:00
Brad King
553df0000f Merge topic 'tasking-flags'
a2f24a7ba7 Tasking: Fix C Compiler standard and extension flags
730f72aa20 Tasking: Fix flag for COMPILE_WARNING_AS_ERROR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10152
2025-01-10 09:09:32 -05:00
Marc Chevrier
00932ea864 Introduce CMAKE_<LANG>_LINK_MODE variable.
This variable define how the link step is done. Possible values are:
* DRIVER: the compiler is used as driver for the link step
* LINKER: the linker is used directly for the link step.
2025-01-10 13:24:16 +01:00
Saurabh Kumar
daf6cc89ee LFortran: Remove hard-coded --generate-object-code flag
This was added in commit 98d0f918ba (LFortran: Add support for this
compiler, 2024-01-25, v3.31.0-rc1~303^2~2) because it is needed for
cases covered by CMake's Fortran tests.  However, it does not work
with Fortran modules and breaks lfortran's own `examples/project1`.
Move the flag to the test cases that need it, just as the original
commit did with `--implicit-interface`.

Fixes: #26597
Co-authored-by: Brad King <brad.king@kitware.com>
2025-01-09 14:49:39 -05:00
Alaa Mahran
a2f24a7ba7 Tasking: Fix C Compiler standard and extension flags
- Remove incorrect `--strict` flag for the C compiler.
- Add C compiler extensions.

Fixes: #26591
2025-01-09 11:49:07 -05:00
Alaa Mahran
730f72aa20 Tasking: Fix flag for COMPILE_WARNING_AS_ERROR
Issue: #26591
2025-01-09 11:49:07 -05:00
Ben Boeckel
a980dab9b1 gcc: support import std 2025-01-08 16:32:14 -05:00
Brad King
71e2596a73 NVHPC: Add support for CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN
NVHPC has a `--gcc-toolchain=` flag just like LLVM/Clang and IntelLLVM.
2024-12-16 14:15:56 -05:00
Brad King
27be881b3f Merge topic 'vs-clang-cl-c++23'
30139913e9 VS: Restore support for mixing C++23 and C in one target with clang-cl
57da8712c1 VS: Factor out check for mixed C and C++ target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10082
2024-12-10 09:12:04 -05:00
Brad King
30139913e9 VS: Restore support for mixing C++23 and C in one target with clang-cl
Since commit 474eafe28c (clang-cl: Add support for C++23, 2024-09-13,
v3.31.0-rc1~97^2) we use a Clang-specific flag to enable C++23 since
`clang-cl` has no `-std:c++23` flag, and `-std:c++latest` may enable an
even newer version of C++.  However, in `.vcxproj` files there is no way
to express a target-wide `-clang:-std=c++23` flag for only C++ sources
when the target also has C sources.  Add a special case to map back to
`-std:c++latest` for targets with C++23 and C together.

Fixes: #26508
2024-12-09 14:57:35 -05:00
David Tenty
a6f2e9eded IBMClang: Express compiler information as a Clang variant
De-duplicate IBMClang compiler information by detecting the base clang
version and following the same logic as we do for any other clang of
that version.  This helps maintain support for new IBMClang features
inherited from new base Clang versions.

We already use this approach for other Clang variants, like CrayClang
and FujitsuClang.
2024-12-04 14:01:52 -05:00
Brad King
8d98c6b1c2 Merge topic 'intel-classic-no-linker-depfile'
aeaec06267 Intel/Classic: deactivate linker dependency file support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10048
2024-11-29 09:59:01 -05:00
Marc Chevrier
aeaec06267 Intel/Classic: deactivate linker dependency file support
The Intel Classic compilers' IPO plugins do not support the
`-Wl,--dependency-file,...` linker flag.

Fixes: #26483
2024-11-28 09:54:22 -05:00
Daniel Brondani
688d9ee9c2 ARMClang: Remove orphaned linker --list option
Setting the `armlink --list` option without other diagnostic flags is
misleading because it produces an empty file and prevents the user from
printing diagnostics to the standard output or redirecting them to
another file.

It's unclear why the flag was added when support for ARMClang was first
added by commit 7b0abaac31 (ARMClang: Add support for Clang-based ARM
compiler, 2019-05-13, v3.15.0-rc1~111^2).

Fixes: #21538
2024-11-18 13:59:16 -05:00
Brad King
34067963cc LFortran: Improve detection of implicit link information for lfortran 0.40+
These versions of LFortran support passing `-v -Wl,-v` to the underlying
compiler so we can extract the full implicit link information.

Issue: #26145
2024-10-24 11:15:12 -04:00
Brad King
cfa888a6e2 Clang/CUDA: Add language-wide flags when linking with compiler driver
We do this for other compiler/language combinations, but these flags
were left out by commit 5df21adf46 (CUDA: Add support for Clang
compiler, 2020-03-07, v3.18.0-rc1~145^2~1).
2024-10-07 11:57:24 -04:00
scivision
247497eacf NVHPC: Record C++23 support
NVHPC 24.9 documents support for `-std=c++23` [1].

[1] https://docs.nvidia.com/hpc-sdk/archive/24.9/hpc-sdk-release-notes/index.html
2024-10-02 10:34:35 -04:00
Brad King
474eafe28c clang-cl: Add support for C++23
Although there is no `cl -std:c++23` flag, the underlying Clang compiler
does have a C++23 mode we can activate by passing `-std=c++23` through a
`clang-cl` wrapper flag.

Fixes: #26061
2024-09-13 12:28:49 -04:00
Brad King
86bc2b000d Tasking: Fix C and C++ compiler extension mode flags
In commit 94df5b6ef1 (Tasking: Add support for several compiler
toolsets, 2022-07-20, v3.25.0-rc1~133^2) the extension mode flags were
added with an extra space-only argument.  Remove it.  Also fix the C++98
mode flag that looks like a C mode flag.

Fixes: #26244
2024-08-28 09:48:48 -04:00
Felipe Torrezan
564d527c04 IAR: Improve error message for missing license
When using the IAR Compiler without a license, CMake issues a
fatal error message about a missing linker and librarian.
This message is misleading.

In the previous detection, CMakeFindBinUtils.cmake would rely
on information collected from try_compile() which depends on a
working license.

In the new detection scheme, the IAR BinUtils are automatically
detected regardless of an existing license, based solely on the
compiler's path.

The failure point will be when trying to compile a C or a CXX
source file, where there will be no CMAKE_${lang}_COMPILER_VERSION
available.

This change improves the resulting message for when trying to use
the compiler without a license.
2024-08-14 09:03:13 +02:00
Patrick H
373b29bd3f Rename {_ => }CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNING
Although not documented publicly, projects may need to override
this variable.  Remove the private `_` prefix from its name.

Issue: #25103
2024-07-29 11:50:02 -04:00
Brad King
4c35a71ae9 Merge topic 'lfortran'
aff38fed4f ci: Add nightly jobs for LFortran on Fedora
a0def56402 ci: Add lfortran to Fedora base image
98d0f918ba LFortran: Add support for this compiler
c6f81bdacf Tests/RunCMake: Pass Fortran compiler id into more tests
fa1b748389 Tests/RunCMake/DependencyGraph: Specify Fortran function return type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Matthew Thompson <fortran@gmail.com>
Merge-request: !9188
2024-07-24 10:02:54 -04:00
Christoph Junghans
98d0f918ba LFortran: Add support for this compiler
Fixes: #25419
2024-07-22 16:50:33 -04:00
Marc Chevrier
c1c4cf9545 Linker configuration: introduce a new architecture
A new set of files are dedicated to linker configuration.
This set of files enable a fine-tuned configuration based of the linker
type as identified during compiler detection.

Fixes: #25360
2024-07-20 19:05:54 +02:00
Brad King
e9d72f611c Merge topic 'IntelLLVM-layout-2024'
ceb58f0ccf IntelLLVM: Update toolchain layout for 2024+ versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9653
2024-07-16 10:30:52 -04:00
Pavel Liavonau
ceb58f0ccf IntelLLVM: Update toolchain layout for 2024+ versions
HPC Intel changed layout of llvm related binary files from
`bin/../bin-llvm` to `bin/compiler`.
2024-07-15 17:07:55 -04:00
Carlo Marcelo Arenas Belón
8a33068afe visibility: add support for Oracle Developer Studio 12.6
While an `-fvisibility` flag was added in the previous version, it
throws warnings indicating it would be ignored unless given to the
linker and fails to work properly.

Tested on Solaris 11.3 SPARC and Solaris 11.4 x86/SPARC.
2024-06-12 03:05:28 -07:00
Brad King
09f2031825 Merge topic 'clang-ansi-color'
1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9592
2024-06-11 10:56:50 -04:00
Brad King
4036eafd95 Merge topic 'clang-ansi-color' into release-3.30
1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9592
2024-06-11 10:56:48 -04:00
Brad King
1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag
In commit 74b5fae52d (Clang: Use -fno-ansi-escape-codes for color
diagnostics on Windows, 2023-10-19, v3.28.0-rc3~3^2) we added the
positive option `-fansi-escape-codes` and the negative form of
the option, `-fno-ansi-escape-codes`.  According to the LLVM/Clang
documentation:

* https://releases.llvm.org/18.1.4/tools/clang/docs/UsersManual.html#cmdoption-fansi-escape-codes

only the positive form of the option exists.

Fixes: #26036
2024-06-10 09:23:41 -04:00
Brad King
88f30da5a0 Merge topic 'qcc-ipo'
95cac24867 QCC: Enable IPO support, inheriting from GNU Compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9545
2024-05-24 10:30:52 -04:00