Commit Graph

985 Commits

Author SHA1 Message Date
Brad King
578ba81424 Merge topic 'clang-ansi-color' into release-3.29
1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9592
2024-06-11 10:55:59 -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
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
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
Marc Chevrier
dc013be1fb Link Step: linker depfile configuration: bug fix
Follow up commit 538ff514b5 (Link Step: use the correct linker
for depfile handling, 2023-10-16)
2023-10-25 16:37:30 +02:00
Brad King
1c15cfe568 Merge topic 'compute-compiler-linker'
538ff514b5 Link Step: use the correct linker for depfile handling
c26c6ac488 Link Step: compute effective linker used by the compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8885
2023-10-24 09:41:23 -04:00
Marc Chevrier
538ff514b5 Link Step: use the correct linker for depfile handling
Follow up commit 375e6fdbbe (Link step: use linker dependency linker
file, 2023-04-19, v3.27.0-rc1~126^2).
2023-10-24 08:36:43 -04:00
Brad King
44c144391d Merge topic 'clang-ansi-color'
74b5fae52d Clang: Use -fno-ansi-escape-codes for color diagnostics on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8900
2023-10-23 12:06:34 -04:00
Cristian Adam
74b5fae52d Clang: Use -fno-ansi-escape-codes for color diagnostics on Windows
-fno-ansi-escape-codes is used only on Windows by Clang.

Without the flag color diagnostics are displayed only if clang.exe
is executed directly. Build tools like ninja and mingw32-make
will not display colored diagnostics.

Using -fno-ansi-escape-codes will make the build tools pass
the colored diagnostics to the calling application e.g IDE.

Fixes: #24235
2023-10-23 09:41:29 -04:00
Brad King
bb9a91c500 Merge topic 'adsp-asm'
0e828b92f1 ADSP: Add support for assembler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8869
2023-10-17 10:17:01 -04:00
Brad King
0ef68c1c05 Merge topic 'remove-comeau'
957670683d Comeau: Remove undocumented support for this compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8881
2023-10-17 10:01:56 -04:00
scivision
957670683d Comeau: Remove undocumented support for this compiler
This appears to be from CMake 2.8 era and was undocumented.
Comeau last release 2008.
2023-10-16 11:11:44 -04:00
مهدي شينون (Mehdi Chinoune)
44faa3773c PGI/NVHPC: Remove -Mipa compiler option for 23.3+
`-Mipa` was removed since 23.3.  The compiler warns about it:

    nvfortran-Warning-The option -Mipa has been deprecated and is ignored.

See: https://docs.nvidia.com/hpc-sdk/archive/23.9/hpc-sdk-release-notes/index.html#deprecations
2023-10-13 14:04:09 -04:00
Sebastian Wendt
0e828b92f1 ADSP: Add support for assembler
In commit e9eabb0dcd (ADSP: Configure compiler in compiler module,
2022-03-24, v3.24.0-rc1~331^2~1) we added compiler information modules
for the ADSP C and C++ compilers.  Add one for the assembler too.
We already identify the ADSP assembler since commit f83330ed6c (ASM:
ADSP assembler identification, 2018-01-30, v3.11.0-rc1~35^2).
2023-10-12 11:04:58 -04:00
Brad King
4c0300a1b8 Merge topic 'LLVMFlang-MSVC'
26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows
e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET
26fa048ffe Tests: Enable CMP0091/CMP0141 for MSVC settings in FortranOnly test
9d060b8682 Fortran: Save CMAKE_LINKER variable persistently for MSVC ABI
7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing
12733d0d8d CMakeParseImplicitLinkInfo: Detect link lines using link.exe and lld-link

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8852
2023-10-04 11:18:41 -04:00
Brad King
1f00b0e230 Merge topic 'LLVMFlang-MSVC' into release-3.28
26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows
e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET
26fa048ffe Tests: Enable CMP0091/CMP0141 for MSVC settings in FortranOnly test
9d060b8682 Fortran: Save CMAKE_LINKER variable persistently for MSVC ABI
7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing
12733d0d8d CMakeParseImplicitLinkInfo: Detect link lines using link.exe and lld-link

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8852
2023-10-04 11:18:40 -04:00
Brad King
26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows
The compiler does not yet support everything needed to integrate well
with the MSVC ABI, in particular for runtime library selection and debug
format selection.  Document them in FIXME comments and leave this
support undocumented by CMake for now.

Fixes: #24840
Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2023-10-03 09:15:24 -04:00
Brad King
e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET 2023-10-02 18:52:02 -04:00
Brad King
8735cbba5d Merge topic 'cxxmodules-no-longer-experimental'
437280b127 cxxmodules: scan C++ sources for imports by default
3cddd11649 Ninja: message about not compiled sources explicitly
068fde1c34 cmGeneratorTarget: use `this->` for method calls
197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
5eb7bd641a Tests/RunCMake/CXXModules: remove rules file requirement
ff18acc301 CXXModules: remove `EXPERIMENTAL` from C++ module variable names
0c07f39006 cmExperimental: remove the flag for C++ modules
68caec9137 Help: add a manpage for cxxmodule support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8828
2023-10-02 11:55:38 -04:00
Ben Boeckel
ff18acc301 CXXModules: remove EXPERIMENTAL from C++ module variable names 2023-10-02 10:17:31 -04:00
Brad King
88c7eaa7a7 Merge topic 'android-clang-c++23'
75e9918a66 Android: Require Clang 18 for -std=c++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !8847
2023-09-28 09:50:36 -04:00
Brad King
75e9918a66 Android: Require Clang 18 for -std=c++23
Update the Clang version checks added by

* commit eacacc70fc (Clang: use -std=c++23 for Clang 17.0+,
                     2023-05-08, v3.27.0-rc1~115^2)
* commit 0183956d30 (Clang: C++26 support,
                     2023-05-16, v3.27.0-rc1~85^2)

to account for Android NDK r26's distribution of a Clang based on a
development version of LLVM/Clang 17.0 that pre-dated addition of
these flags.

Follow the pattern from commit 12e6796b62 (Android: Do not pass
non-existent Clang -std flags, 2018-04-02, v3.12.0-rc1~284^2),
which fixed the same problem for `-std=c++17`.

Fixes: #25281
2023-09-27 12:56:49 -04:00
Brad King
5d32320bf3 Merge topic 'hip-nvidia'
fd982eec10 HIP: Add tests for special NVIDIA values of CMAKE_HIP_ARCHITECTURES
8c8b3f1bfa HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC
b3e92775ab HIP: Add CMAKE_HIP_HOST_COMPILER when compiler is NVCC
e43918b4ca HIP: Fix linking mixed-lang binary with CXX compiler and Makefile generators
4794505122 HIP: Do not require hip-lang package for NVIDIA platform
09d759dc7f HIP: Simplify exclusion of AMD device runtime with NVIDIA GPUs
2a60663670 HIP: Simplify CMAKE_GENERATOR references for determining compiler
8124950f6c CUDA: Generalize CMAKE_{CUDA => <LANG>}_HOST_COMPILER variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8836
2023-09-26 09:40:25 -04:00
Brad King
0be496cb5a Merge topic 'orangec-compiler'
f8fa4f1ad7 ci: Add OrangeC 6.73.1 nightly CI job
531b4fe643 OrangeC: Add support for OrangeC compiler
10f435a58f Tests: Simplify nested if conditions in Complex tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Victor <lostfreeman@gmail.com>
Merge-request: !8592
2023-09-26 09:23:10 -04:00
Xing Xue
961a077238 IBMClang: Add provisional flags for C++23
With this one can use the IBM Open XL C/C++ compiler to build projects
that require feature `cxx_std_23`.
2023-09-25 19:05:31 -04:00
Brad King
09d759dc7f HIP: Simplify exclusion of AMD device runtime with NVIDIA GPUs 2023-09-25 16:06:36 -04:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Brad King
89d155e1bb Merge topic 'CrayClang-compiler'
80838316a8 CrayClang: Add support for this compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8781
2023-09-25 08:58:25 -04:00
Brad King
82a2f198d8 Merge topic 'cxxmodules-gcc-14'
4089954595 gitlab-ci: update to GCC CI container with merged P1689R5
c2564f5916 ci: drop extra scandep source settings for GCC
ee52a02d56 ci: update GCC build to use master after P1689R5 is merged
4f0410959e GCC: add rules for scanning C++ module dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8827
2023-09-25 08:56:04 -04:00
Ryan Krattiger
80838316a8 CrayClang: Add support for this compiler
Add `CrayClang` compiler ID for newer Cray compilers.

Fixes: #25102
2023-09-22 09:39:52 -04:00
Brad King
18158bf81c HIP: Add support for NVIDIA GPUs
Add support for using the CUDA Toolkit's NVCC to compile HIP code.

Fixes: #25143
2023-09-21 15:34:37 -04:00
Brad King
e1b2a5062f CUDA: Factor out some NVCC compiler information
Prepare to use nvcc for other languages.
2023-09-21 15:34:27 -04:00
Ben Boeckel
4f0410959e GCC: add rules for scanning C++ module dependencies 2023-09-21 09:44:48 -04:00
Bram Metsch
e30f0f89af IntelLLVM: Suppress -Rdebug-disables-optimization on debug builds
IntelLLVM 2023.0.0 and above emit this remark if `-g` is used without
any `-O<level>` flag, which is our default behavior.  Add another flag
to suppress the remark.
2023-09-07 15:15:08 -04:00
Brad King
0788accdfc Merge topic 'imported-cxxmodules'
48ee946fdc cmExperimental: recycle the C++ modules API UUID
1a1806a71b gitlab-ci: declare `bmionly` support for modules where possible
457a12f3f9 Tests/RunCMake/CXXModules: add tests which use modules from imported targets
9b9ec70b54 Ninja: generate scanning and build rules for C++20 module synthetic targets
80ef50a191 CXXModules: add a variable for BMI-only compilation
80d6544398 cxxmodules: generate synthetic targets as an initial pass
3dc6676ecc cmSyntheticTargetCache: add a struct for synthetic target caching
cb356b540c cmCxxModuleUsageEffects: add a class to capture module usage effects
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8535
2023-08-21 09:49:48 -04:00