Commit Graph

1016 Commits

Author SHA1 Message Date
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
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
Pablo Romero
95cac24867 QCC: Enable IPO support, inheriting from GNU Compiler
Fixes: #26007
2024-05-23 11:44:39 -04:00
Rupert Clarke
23c91b55d6 ADSP: Treat .s files as asm sources 2024-05-21 10:16:11 -04:00
Rupert Clarke
43b5e88fe6 ADSP: Preserve ASM output ext and flags as we do for C and CXX
Revise commit 0e828b92f1 (ADSP: Add support for assembler, 2023-10-12,
v3.29.0-rc1~568^2).
2024-05-21 10:15:48 -04:00
Ben Boeckel
a46395df06 importstd: clarify when the experimental UUID must be available
Fixes: #25980
2024-05-15 07:15:05 -04:00
Brad King
646c921ce6 Merge topic 'intel-std'
80d4bd5370 IntelLLVM: Record C++26 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9511
2024-05-14 10:24:22 -04:00
scivision
80d4bd5370 IntelLLVM: Record C++26 support 2024-05-13 11:02:04 -04:00
Ben Boeckel
c0385a6b9c Modules/Compiler/Clang: add a reason for non-libc++ compilations
See: #25965
2024-05-09 15:45:05 -04:00
Ben Boeckel
6dad18f060 cxxmodules: give a reason for unavailability of import std
If the `CMAKE_CXX<STANDARD>_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE`
variable is set, include its value in the error message.
2024-05-02 14:46:51 -04:00
Tyler
7c38e6bb52 Add CMAKE_<LANG>_STANDARD_LATEST variables
Add a variable to indicate the latest standard known to be supported for
each language:

* `CMAKE_C_STANDARD_LATEST`
* `CMAKE_CXX_STANDARD_LATEST`
* `CMAKE_CUDA_STANDARD_LATEST`
* `CMAKE_HIP_STANDARD_LATEST`
* `CMAKE_OBJC_STANDARD_LATEST`
* `CMAKE_OBJCXX_STANDARD_LATEST`

These variables, more generally referred to as
`CMAKE_<LANG>_STANDARD_LATEST`, are assigned an integer value which
represents the minimum between the latest version of the associated
language standard supported by the current compiler and the latest
version supported by CMake.

Add documentation for these variables in a new page called
`CMAKE_<LANG>_STANDARD_LATEST` was added under the "Variables for
Languages" section of the `cmake-variables(7)` page.

Update each compiler-specific CMake script under
`${CMAKE_ROOT}\Modules\Compiler` to manually define the relevant
`CMAKE_<LANG>_STANDARD_LATEST` variable as necessary. This will
require updating and maintaining as newer compiler versions become
recognized by CMake.

Closes: #25717
2024-04-30 11:05:03 -04:00
Tyler Nichols
fddb165c6c AppleClang: Fix Objective C 23 support detection
Set the requirement for Objective C 23 support for AppleClang to
`11.0.3` in `${CMAKE_ROOT}\Modules\Compiler\AppleClang-OBJC.cmake`.
This is consistent with the requirement for C 23 support as
indicated in `${CMAKE_ROOT}\Modules\Compiler\AppleClang-C.cmake`.
2024-04-30 11:05:03 -04:00
Tyler Nichols
1dff17108d Modules: Fix ARMClang and TIClang language standard compile options
Unset irrelevant compile option variables in the following scripts:
  * `${CMAKE_ROOT}\Modules\Compiler\ARMClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-CXX.cmake`

These scripts all include either
`${CMAKE_ROOT}\Modules\Compiler\Clang-C.cmake` or
`${CMAKE_ROOT}\Modules\Compiler\Clang-CXX.cmake`, and those scripts
will set various compile option variables based on what the
standard version of Clang supports. However, these do not
necessarily apply to ARMClang and TIClang. This commit thus
explicitly unsets all of the compile option variables which are not
manually defined for these compilers.
2024-04-30 11:05:03 -04:00
René Bertin
f65a6d2cb1 GNU: Do not use "fat-lto-objects" flags for IPO on Apple platforms
Fat LTO objects contain both traditional object code and the LTO bitcode
IR, but the GNU compiler does not support them on Apple platforms.
A compile error is raised when `-f[no-]fat-lto-objects` flags are used,
so avoid them.

This also implies that static Fortran libraries cannot be built with IPO.

Fixes: #25931
2024-04-24 16:57:36 -04:00
huangqinjin
abb33568e6 cxxmodules: Support import std for msvc-wine 2024-04-21 20:40:52 +08:00
Ben Boeckel
678717f3e4 cxxmodules: provide a detection variable for import std 2024-04-18 09:53:21 -04:00
Raul Tambre
1ba4a06338 GNU: Add flags for C++26 modes
Flags added in GCC commit `5388a43f6a3` (c++: Add support for
-std={c,gnu}++2{c,6}, 2023-06-22).
2024-04-16 15:34:57 -04:00
Brad King
8f7049112d Merge topic 'nag-fortran-ninja'
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
765a611956 NAG-Fortran: Added initial default compilation flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9407
2024-04-16 08:53:56 -04:00
Simon Maertens
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
Fixes: #21398
2024-04-15 13:33:30 -04:00
Simon Maertens
765a611956 NAG-Fortran: Added initial default compilation flags
The configuration of the NAG Fortran compiler was previously missing the
standard flags for debug, release and the other build types.
2024-04-15 13:32:06 -04:00
Ben Boeckel
429902ebad Clang: support creating a target for imported modules 2024-04-12 11:46:40 -04:00
Ben Boeckel
4617f272b4 MSVC: support import std 2024-04-12 11:46:40 -04:00
Ben Boeckel
15bbd1d9b8 Experimental: add an experimental feature gate for import std 2024-04-12 11:46:39 -04:00
Ben Boeckel
f80c60df02 CMakeDetermineCompilerSupport: construct C++ modules targets
Compilers may implement this by implementing a `_cmake_cxx_import_std`
function which takes the standard version as an argument (e.g., `23`)
and creating a target named `CMake::CXX${std}` that represents how
`import std;` should be represented within CMake.
2024-04-12 09:32:29 -04:00
Raul Tambre
f21dbf8f26 C++26: Fix C++/CUDA/HIP compile feature support
In commit f808d8afb9 (CMake: Support upcoming C++26 language level,
2022-08-19, v3.25.0-rc1~218^2) we forgot some necessary scaffolding.

Fixes: #25819
2024-04-09 11:38:59 +03:00
Brad King
ae18811f2e IntelLLVM: Add C standard flags on Windows 2024-04-03 19:34:03 -04:00
Brad King
529ccb3dff IntelLLVM: Use C23 and C++23 flags only versions supporting them
Revise commit 4331f7b4bf (IntelLLVM: Add provisional flags for C23 and
C++23, 2023-01-12, v3.26.0-rc1~86^2).
2024-04-03 19:34:03 -04:00
Brad King
3ca7f37e5a Intel: Fix classic compiler version check for C++20 flag
The `-std=c++20` flag was added by Intel compiler 2019 update 3.
2024-04-03 19:34:03 -04:00
Brad King
f8ba5b12ca Merge topic 'refactor-compile-features-and-flags'
588371d2d5 Modules: Rename CMakeDetermine{CompileFeatures -> CompilerSupport}
4d27ef55bd Modules: Factor out helpers for GNU language standard flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9366
2024-04-02 08:13:18 -04:00
Tyler
4d27ef55bd Modules: Factor out helpers for GNU language standard flags
Add the following macros to `${CMAKE_ROOT}\Modules\Compiler\GNU.cmake`:

* `__compiler_gnu_c_standards()`
* `__compiler_gnu_cxx_standards()`

These macros are used to define the
`CMAKE_<LANG><STANDARD>_STANDARD_COMPILE_OPTION` and
`CMAKE_<LANG><STANDARD>_EXTENSION_COMPILE_OPTION` variables for C-
and C++-based languages for GCC. The macros are similar to the
existing `__compiler_clang_cxx_standards()` macro found in
`${CMAKE_ROOT}\Modules\Compiler\Clang.cmake`.
2024-03-29 14:27:20 -06:00
Brad King
a80d8e839d IntelLLVM: Revert accidental use of -external:I with Fortran compilers
In commit 8218aed118 (IntelLLVM: support marking include paths as SYSTEM
directories, 2023-08-15, v3.29.0-rc1~81^2) this flag was added for the C
and C++ compilers, but was accidentally added for Fortran too.  Remove
it for the latter, as it is unsupported.

Issue: #25807
2024-03-24 15:03:11 -04:00
Brad King
c29bc18b10 Merge topic 'cxxmodules-clang-resource-dir'
a3ada1a241 Clang: detect -resource-dir for clang-scan-deps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9274
2024-02-22 08:24:00 -05:00
Brad King
a4122c89c4 Merge topic 'cxxmodules-clang-resource-dir' into release-3.29
a3ada1a241 Clang: detect -resource-dir for clang-scan-deps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9274
2024-02-22 08:23:58 -05:00
Ben Boeckel
a3ada1a241 Clang: detect -resource-dir for clang-scan-deps
When cross-compiling, `clang-scan-deps` needs help to find the correct
location of core headers such as `stddef.h`. Always determine this path
and pass it when available.

Fixes: #25590
2024-02-21 08:51:42 -05:00
Ruslan Baratov
2d72a861d7 IPO: Support duplicate object names in large archives
Apply the fix from commit 1ec6485c6a (Support duplicate object names in
large archives, 2014-04-16, v3.1.0-rc1~629^2) to the IPO-specific
archiving rules.  Use "quick append" instead of "replace".

Fixes: #25675
Issue: #14874
2024-02-15 11:08:45 -05:00
Alan Phipps
9ba0a54554 TIClang: Add support for TI Clang-based compilers, including tiarmclang
Add TIClang compiler ID and support in compiler modules.  Update
documentation.  Add rudimentary RunCMake test for TIClang to test
basic functionality.

Fixes: #24619
2024-02-09 15:54:40 -05:00
Ben Boeckel
8218aed118 IntelLLVM: support marking include paths as SYSTEM directories
Also learn how to suppress warnings when possible.

See: https://discourse.cmake.org/t/icx-on-windows-supports-external-i/8739
2024-01-24 14:21:05 -05:00
Brad King
88c740462c CUDA/Clang: Add support for MSVC ABI on Windows using GNU-like frontend
Fixes: #20776
2024-01-22 09:33:54 -05:00
makise-homura
59eb9ddecf LCC: Correct C compiler default C standards 2024-01-16 07:18:51 +03:00
makise-homura
020e80d825 LCC: Add missing C/CXX compiler version checks for -std options 2024-01-08 15:25:57 -05:00
Josh Channings
fccb1d3a36 ADSP: Use compiler-reported preprocessor dependencies 2023-12-12 17:44:25 +00:00
Marc Chevrier
0502b345f2 LLVMFlang Fortran: enhance link capabilities
* Add support for "LINKER:" prefix.
* Add support, on Linux, for linker selection through CMAKE_LINKER_TYPE variable.
2023-12-08 19:22:24 +01:00
Brad King
d0dc8eea2f Merge topic 'gfortran-flags'
4597fee41f GNU: Remove duplicate and unnecessary optimization flags for gfortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8994
2023-11-22 07:24:01 -05:00
Brad King
874b62abb4 Merge topic 'clang-scan-deps-failed-scan'
77a7edb73f Clang-CXX: copy into the dyndep output on success

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Namniav W <namniav@gmail.com>
Merge-request: !8991
2023-11-22 07:20:05 -05:00
Ben Boeckel
77a7edb73f Clang-CXX: copy into the dyndep output on success
When `clang-scan-deps` fails to scan (e.g., bad source syntax, junk
flags, etc.), the redirection unconditionally updates the file. If this
fails, the `.ddi` file timestamp is updated. If the state is then
reverted (e.g., the command line returns to the state of the last
successful build), the updated file is not useful, but `ninja` does not
rerun because:

- the command hash matches the last successful run
- the output file is newer than its inputs

However, since the `.ddi` file has been updated with bogus contents from
a failed scan, collation fails as the `rules` array is empty (or
incomplete from a batch scan).

If `clang-scan-deps` were properly aware of its output file, it could
use this to not write the file if any inner scan fails. Requested in
https://github.com/llvm/llvm-project/issues/72875.

See: https://github.com/llvm/llvm-project/issues/72875
Fixes: #25429
2023-11-21 09:41:59 -05:00
Brad King
4597fee41f GNU: Remove duplicate and unnecessary optimization flags for gfortran
Since commit a66004bee0 (Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in
toolchain files, 2016-07-05, v3.7.0-rc1~392^2) we've accidentally been
adding extra optimization flags instead of replacing unwanted flags.

Fixes: #25434
2023-11-21 08:19:15 -05:00
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00