summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'qcc-ipo'Brad King2024-05-241-8/+0
|\ | | | | | | | | | | | | 95cac24867 QCC: Enable IPO support, inheriting from GNU Compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9545
| * QCC: Enable IPO support, inheriting from GNU CompilerPablo Romero2024-05-231-8/+0
| | | | | | | | Fixes: #26007
* | ADSP: Treat .s files as asm sourcesRupert Clarke2024-05-211-1/+1
| |
* | ADSP: Preserve ASM output ext and flags as we do for C and CXXRupert Clarke2024-05-211-2/+0
|/ | | | | Revise commit 0e828b92f1 (ADSP: Add support for assembler, 2023-10-12, v3.29.0-rc1~568^2).
* importstd: clarify when the experimental UUID must be availableBen Boeckel2024-05-151-1/+1
| | | | Fixes: #25980
* Merge topic 'intel-std'Brad King2024-05-141-2/+23
|\ | | | | | | | | | | | | 80d4bd5370 IntelLLVM: Record C++26 support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9511
| * IntelLLVM: Record C++26 supportscivision2024-05-131-2/+23
| |
* | Modules/Compiler/Clang: add a reason for non-`libc++` compilationsBen Boeckel2024-05-091-0/+3
|/ | | | See: #25965
* cxxmodules: give a reason for unavailability of `import std`Ben Boeckel2024-05-023-0/+42
| | | | | If the `CMAKE_CXX<STANDARD>_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE` variable is set, include its value in the error message.
* Add CMAKE_<LANG>_STANDARD_LATEST variablesTyler2024-04-3048-50/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* AppleClang: Fix Objective C 23 support detectionTyler Nichols2024-04-301-1/+1
| | | | | | | 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`.
* Modules: Fix ARMClang and TIClang language standard compile optionsTyler Nichols2024-04-303-0/+27
| | | | | | | | | | | | | | | | 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.
* GNU: Do not use "fat-lto-objects" flags for IPO on Apple platformsRené Bertin2024-04-241-1/+1
| | | | | | | | | | | 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
* cxxmodules: Support `import std` for msvc-winehuangqinjin2024-04-211-0/+1
|
* cxxmodules: provide a detection variable for `import std`Ben Boeckel2024-04-181-0/+3
|
* GNU: Add flags for C++26 modesRaul Tambre2024-04-161-0/+5
| | | | | Flags added in GCC commit `5388a43f6a3` (c++: Add support for -std={c,gnu}++2{c,6}, 2023-06-22).
* Merge topic 'nag-fortran-ninja'Brad King2024-04-161-0/+10
|\ | | | | | | | | | | | | | | | | | | 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
| * NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sourcesSimon Maertens2024-04-151-0/+3
| | | | | | | | Fixes: #21398
| * NAG-Fortran: Added initial default compilation flagsSimon Maertens2024-04-151-0/+7
| | | | | | | | | | The configuration of the NAG Fortran compiler was previously missing the standard flags for debug, release and the other build types.
* | Clang: support creating a target for imported modulesBen Boeckel2024-04-121-0/+153
| |
* | MSVC: support `import std`Ben Boeckel2024-04-121-0/+102
| |
* | Experimental: add an experimental feature gate for `import std`Ben Boeckel2024-04-121-0/+11
| |
* | CMakeDetermineCompilerSupport: construct C++ modules targetsBen Boeckel2024-04-121-0/+35
| | | | | | | | | | | | | | 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.
* | C++26: Fix C++/CUDA/HIP compile feature supportRaul Tambre2024-04-091-0/+9
| | | | | | | | | | | | | | 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
* | IntelLLVM: Add C standard flags on WindowsBrad King2024-04-031-11/+10
| |
* | IntelLLVM: Use C23 and C++23 flags only versions supporting themBrad King2024-04-032-8/+16
| | | | | | | | | | Revise commit 4331f7b4bf (IntelLLVM: Add provisional flags for C23 and C++23, 2023-01-12, v3.26.0-rc1~86^2).
* | Intel: Fix classic compiler version check for C++20 flagBrad King2024-04-031-1/+1
| | | | | | | | The `-std=c++20` flag was added by Intel compiler 2019 update 3.
* | Merge topic 'refactor-compile-features-and-flags'Brad King2024-04-023-83/+89
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Modules: Factor out helpers for GNU language standard flagsTyler2024-03-293-83/+89
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * Merge topic 'cxxmodules-clang-resource-dir'Brad King2024-02-221-0/+8
| |\ | | | | | | | | | | | | | | | | | | a3ada1a241 Clang: detect -resource-dir for clang-scan-deps Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9274
* | | IntelLLVM: Revert accidental use of -external:I with Fortran compilersBrad King2024-03-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'cxxmodules-clang-resource-dir' into release-3.29Brad King2024-02-221-0/+8
|\ \ \ | |/ / |/| / | |/ | | | | | | a3ada1a241 Clang: detect -resource-dir for clang-scan-deps Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9274
| * Clang: detect -resource-dir for clang-scan-depsBen Boeckel2024-02-211-0/+8
| | | | | | | | | | | | | | | | 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
* | IPO: Support duplicate object names in large archivesRuslan Baratov2024-02-155-10/+10
| | | | | | | | | | | | | | | | | | 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
* | TIClang: Add support for TI Clang-based compilers, including tiarmclangAlan Phipps2024-02-097-0/+99
| | | | | | | | | | | | | | | | Add TIClang compiler ID and support in compiler modules. Update documentation. Add rudimentary RunCMake test for TIClang to test basic functionality. Fixes: #24619
* | IntelLLVM: support marking include paths as SYSTEM directoriesBen Boeckel2024-01-241-0/+6
| | | | | | | | | | | | Also learn how to suppress warnings when possible. See: https://discourse.cmake.org/t/icx-on-windows-supports-external-i/8739
* | CUDA/Clang: Add support for MSVC ABI on Windows using GNU-like frontendBrad King2024-01-221-0/+1
| | | | | | | | Fixes: #20776
* | LCC: Correct C compiler default C standardsmakise-homura2024-01-161-1/+1
| |
* | LCC: Add missing C/CXX compiler version checks for -std optionsmakise-homura2024-01-082-20/+39
| |
* | ADSP: Use compiler-reported preprocessor dependenciesJosh Channings2023-12-121-0/+2
| |
* | LLVMFlang Fortran: enhance link capabilitiesMarc Chevrier2023-12-081-0/+3
| | | | | | | | | | * Add support for "LINKER:" prefix. * Add support, on Linux, for linker selection through CMAKE_LINKER_TYPE variable.
* | Merge topic 'gfortran-flags'Brad King2023-11-222-7/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | 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
| * | GNU: Remove duplicate and unnecessary optimization flags for gfortranBrad King2023-11-212-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'clang-scan-deps-failed-scan'Brad King2023-11-221-1/+16
|\ \ \ | |/ / |/| / | |/ | | | | | | | | 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
| * Clang-CXX: copy into the dyndep output on successBen Boeckel2023-11-211-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge branch 'backport-ci-fedora-39' into ci-fedora-39Brad King2023-11-172-2/+2
|\ \ | |/
| * codespell: Fix typosBrad King2023-11-172-2/+2
| |
* | Link Step: linker depfile configuration: bug fixMarc Chevrier2023-10-251-5/+6
| | | | | | | | | | Follow up commit 538ff514b5 (Link Step: use the correct linker for depfile handling, 2023-10-16)
* | Merge topic 'compute-compiler-linker'Brad King2023-10-241-11/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | 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
| * | Link Step: use the correct linker for depfile handlingMarc Chevrier2023-10-241-11/+18
| | | | | | | | | | | | | | | Follow up commit 375e6fdbbe (Link step: use linker dependency linker file, 2023-04-19, v3.27.0-rc1~126^2).