summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* LFortran: Improve detection of implicit link information for lfortran 0.40+Brad King2024-10-241-1/+1
| | | | | | | These versions of LFortran support passing `-v -Wl,-v` to the underlying compiler so we can extract the full implicit link information. Issue: #26145
* Clang/CUDA: Add language-wide flags when linking with compiler driverBrad King2024-10-071-2/+2
| | | | | | 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).
* NVHPC: Record C++23 supportscivision2024-10-021-0/+7
| | | | | | 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
* clang-cl: Add support for C++23Brad King2024-09-131-3/+11
| | | | | | | | 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
* Tasking: Fix C and C++ compiler extension mode flagsBrad King2024-08-282-6/+6
| | | | | | | | | 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
* IAR: Improve error message for missing licenseFelipe Torrezan2024-08-142-5/+5
| | | | | | | | | | | | | | | | | | | | | 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.
* Rename {_ => }CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNINGPatrick H2024-07-292-2/+2
| | | | | | | Although not documented publicly, projects may need to override this variable. Remove the private `_` prefix from its name. Issue: #25103
* Merge topic 'lfortran'Brad King2024-07-241-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * LFortran: Add support for this compilerChristoph Junghans2024-07-221-0/+14
| | | | | | | | Fixes: #25419
* | Linker configuration: introduce a new architectureMarc Chevrier2024-07-201-54/+0
|/ | | | | | | | 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
* Merge topic 'IntelLLVM-layout-2024'Brad King2024-07-161-1/+4
|\ | | | | | | | | | | | | ceb58f0ccf IntelLLVM: Update toolchain layout for 2024+ versions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9653
| * IntelLLVM: Update toolchain layout for 2024+ versionsPavel Liavonau2024-07-151-1/+4
| | | | | | | | | | HPC Intel changed layout of llvm related binary files from `bin/../bin-llvm` to `bin/compiler`.
| * Merge topic 'clang-ansi-color' into release-3.30Brad King2024-06-111-1/+1
| |\ | | | | | | | | | | | | | | | | | | 1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9592
* | | visibility: add support for Oracle Developer Studio 12.6Carlo Marcelo Arenas Belón2024-06-122-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge topic 'clang-ansi-color'Brad King2024-06-111-1/+1
|\ \ \ | |/ / |/| / | |/ | | | | | | 1004cc2b52 Clang: Drop non-existent -fno-ansi-escape-codes flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9592
| * Clang: Drop non-existent -fno-ansi-escape-codes flagBrad King2024-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | 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