summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMakeDetermineCompilerId: Fix CMAKE_EXECUTABLE_FORMAT in CMP0126 NEW behaviorBrad King2021-07-191-4/+0
| | | | | | | | Setting `CMAKE_EXECUTABLE_FORMAT` as a normal variable is unnecessary because setting it as a cache entry already makes the value visible to the calling scope. Fixes: #22433
* HIP: Extract clang compiler details from hipccRobert Maynard2021-06-071-0/+35
|
* ROCMClang: Add the ROCm toolkit derived clang compiler to CMakeRobert Maynard2021-06-071-1/+0
|
* Modules: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-1/+1
|
* FujitsuClang: Use GNU-like command-linePaul Zehner2021-04-141-0/+2
|
* Merge topic 'flags-with-backslash'Brad King2021-04-081-5/+6
|\ | | | | | | | | | | | | 3953dfcb31 Restore support for backslashes in initial language-wide flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5995
| * Restore support for backslashes in initial language-wide flagsBrad King2021-04-071-5/+6
| | | | | | | | | | | | | | | | | | | | Refactoring in commit bdc40742bd (CMakeDetermineCompilerId: Test without COMPILER_ID_FLAGS if REQUIRE_SUCCESS, 2021-02-27, v3.20.0-rc3~6^2) added an extra macro layer through which flag strings are passed. That caused an extra level of argument re-parsing, and broke flags with backslashes. Pass flags to the helper macro through variable names instead. Fixes: #22041
* | Fujitsu: Add support for the Fujitsu compiler in Trad modeChuck Atkins2021-03-301-2/+23
| | | | | | | | Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
* | VS: switch to new folder structure while keeping the old one workingMarcel Ritzschke2021-03-181-3/+13
|/ | | | Fixes: #21170
* CMakeDetermineCompilerId: Fix REQUIRE_SUCCESS with multiple user flagsRaul Tambre2021-03-021-1/+1
| | | | Need to quote the list expansion otherwise we'll try each argument separately.
* CMakeDetermineCompilerId: Test without COMPILER_ID_FLAGS if REQUIRE_SUCCESSRaul Tambre2021-02-271-16/+34
| | | | | | | If we REQUIRE_SUCCESS, i.e. TEST_FLAGS_FIRST must work, we need to also try without user flags. Fixes #21869.
* CMakeDetermineCompilerId: Recognize XCOFF executable formatBrad King2021-02-031-0/+5
|
* IntelLLVM: Add support for Intel LLVM-based compilersWilliam R. Dieter2021-01-281-1/+2
| | | | | | | | | | | | | | | | | | Using a single ID 'IntelLLVM' for the suite of Intel compilers based on the LLVM backend. The 'IntelLLVM' ID are used for C, C++, and Fortran. Data Parallel C++ will be handled in a separate commit. The C and C++ definitions are based on the Clang definitions. The Intel LLVM-based C and C++ compilers are based on the Clang front end, so existing Clang options are more likely to be a good match than options for the older Intel compilers. Fortran is based on the older Fortran front end with the LLVM backend. It has a similar interface to the older versions, though many options are shared with the C and C++ compilers. Fixes: #21561 Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* CMakeDetermineCompilerId: Ensure CMAKE_EXECUTABLE_FORMAT is INTERNALCraig Scott2020-12-171-2/+2
| | | Fixes: #21607
* CMakeDetermineCompilerId: support Intel DPC++ compiler toolset for VS genNikita Sirgienko2020-12-061-3/+10
| | | | | | | | | | | | | Before Intel have only one compiler icl (Intel(R) C++ compiler) and CMakeDetermineCompilerId has considered, that all toolchains with a word "Intel" in the toolchain name is a icl compiler. But now Intel have also other compiler - Intel(R) DPC++ compiler, which haven't working with cmake on Visual Studio Generator because cmake try to use icl compiler, which cmake can't found and because of this fails the configuration. This commit fix this problem, and both compilers start to work correctly with Visual Studio generator. Fixes: #21546
* Merge topic 'compiler-id-extra-text'Brad King2020-12-041-7/+16
|\ | | | | | | | | | | | | | | | | f25ac39dee CMakeDetermineCompilerId: Tolerate stray text around INFO strings 5cb66f17ca CMakeDetermineCompilerId: Add whitespace to clarify logic 1ee99104f7 CMakeDetermineCompilerId: Filter IAR-AVR format INFO strings earlier Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5570
| * CMakeDetermineCompilerId: Tolerate stray text around INFO stringsBrad King2020-12-031-0/+4
| | | | | | | | | | | | | | | | | | | | When cross-compiling with Xcode our compiler id test binary may be compiled with multiple architectures. The INFO strings should be identical and therefore de-duplicated. However, this can be broken by stray text that happens to sit immediately before or after an INFO string. Filter out such text so we can match clean INFO strings. Fixes: #21526
| * CMakeDetermineCompilerId: Add whitespace to clarify logicBrad King2020-12-031-1/+5
| | | | | | | | Also initialize a variable closer to its use.
| * CMakeDetermineCompilerId: Filter IAR-AVR format INFO strings earlierBrad King2020-12-031-6/+7
| | | | | | | | Remove the bytes between characters from the entire list at once.
| * Merge topic 'cuda_detect_vs_codegen' into release-3.19Brad King2020-11-251-4/+8
| |\ | | | | | | | | | | | | | | | | | | 20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5531
* | | Makefiles Generators: use compiler for dependencies generationMarc Chevrier2020-11-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each source compilation generates a dependencies file. These dependencies files are consolidated in one file per target. This consolidation is done as part of command 'cmake -E cmake_depends` launched before evaluation of makefile dependency graph. The consolidation uses the same approach as `CMake` dependencies management. Fixes: #21321
* | | Merge topic 'cuda_detect_vs_codegen'Brad King2020-11-251-4/+8
|\ \ \ | |/ / |/| / | |/ | | | | | | 20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5531
| * CUDA: Fix user-set architectures during detection with Visual StudioRaul Tambre2020-11-251-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | If the user specifies CMAKE_CUDA_ARCHITECTURES we use those during detection and error out if they don't work. For Visual Studio a dummy project file is used instead of invoking the compiler directly. NVCC would thus use its default and we'd fail if CMAKE_CUDA_ARCHITECTURES was anything other than NVCC's default. Use the necessary project file variable in CMakeDetermineCompilerId.cmake to match other generators. Fixes #21492.
* | Xcode: Default to arm64 arch on Apple Silicon hosts during compiler idBrad King2020-11-121-1/+8
| | | | | | | | | | | | | | | | | | | | In commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we forgot to update the compiler id architecture selection added by commit 26673bf480 (Xcode: Explicitly specify default native architecture on macOS, 2020-07-16, v3.18.1~20^2). Issue: #21425
* | Merge topic 'cuda_host_compiler_fail'Brad King2020-09-011-3/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | 01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection 9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5155
| * | CUDA: Fail if compiler detection using the host compiler failsRaul Tambre2020-08-291-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an user specified a host compiler we should fail if we are unable to perform compiler detection with it. Previously we would try without and likely succeed and continue. Then we'd fail during ABI detection and compiler testing since we'd still try to use it. This is particularly problematic when crosscompiling since we extract the host linker from the compiler detection link line. This would result in the wrong host linker being used and a linking error due to architecture mismatch during ABI detection where other necessary flags may already be present to make the host compiler work. See #21076 for an example. Fix this by adding CMAKE_<LANG>_COMPILER_ID_REQUIRE_SUCCESS to CMakeDetermineCompilerId, which throws a fatal error if executing the compiler results in a non-zero exit code. Fixes #21120.
* | | Add ISPC compiler support to CMakeRobert Maynard2020-08-281-0/+22
|/ /
* | Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detectionFred Baksik2020-07-291-1/+3
| | | | | | | | Fixes: #20040
* | Fix typos identified using codespellJean-Christophe Fillion-Robin2020-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/codespell-project/codespell#readme The following command was used: ``` codespell -q6 --skip="\ .git,\ *.json,\ ./Copyright.txt,\ ./Help/command/foreach.rst,\ ./Help/prop_test/REQUIRED_FILES.rst,\ ./Help/variable/CTEST_COVERAGE_COMMAND.rst,\ ./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\ ./Modules/CMakeRCInformation.cmake,\ ./Modules/Internal/CPack/NSIS.template.in,\ ./Modules/FindMatlab.cmake,\ ./Modules/MatlabTestsRedirect.cmake,\ ./Modules/Platform/Windows-Clang.cmake,\ ./Modules/Platform/Windows-Intel-Fortran.cmake,\ ./Modules/Platform/Windows-MSVC.cmake,\ ./Source/CMakeVersion.cmake,\ ./Source/cmConvertMSBuildXMLToJSON.py,\ ./Source/cmCreateTestSourceList.cxx,\ ./Source/cmGlobalVisualStudio10Generator.cxx,\ ./Source/cmExportBuildFileGenerator.cxx,\ ./Source/cmExportInstallAndroidMKGenerator.cxx,\ ./Source/cmExportInstallFileGenerator.cxx,\ ./Source/cmExportSet.cxx,\ ./Source/cmExportTryCompileFileGenerator.cxx,\ ./Source/cmFindPackageCommand.cxx,\ ./Source/cmInstallCommand.cxx,\ ./Source/cmGeneratorExpressionLexer.cxx,\ ./Source/cmLocalVisualStudio7Generator.cxx,\ ./Source/cmOrderDirectories.cxx,\ ./Source/cmTarget.cxx,\ ./Source/kwsys/*,\ ./Source/QtDialog/CMakeSetupDialog.ui,\ ./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\ ./Source/CTest/cmParseCoberturaCoverage.h,\ ./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\ ./Tests/RunCMake/GoogleTest/xml_output.cpp,\ ./Tests/RunCMake/Make/TargetMessages*,\ ./Utilities/*,\ " \ -L "\ dependees,\ endwhile,\ fo,\ filetest,\ helpfull,\ nd,\ objext,\ stoll,\ supercedes,\ superceded,\ vas,\ varn,\ " ```
* | Merge topic 'xcode-native-arch'Craig Scott2020-07-211-0/+6
|\ \ | |/ | | | | | | | | | | | | 26673bf480 Xcode: Explicitly specify default native architecture on macOS ce624cfbd4 cmGlobalXCodeGenerator: Save CMAKE_SYSTEM_NAME in member Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5023
| * Xcode: Explicitly specify default native architecture on macOSBrad King2020-07-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | When `CMAKE_OSX_ARCHITECTURES` is not specified, we add the Xcode setting `ONLY_ACTIVE_ARCH = YES` with the intention of targeting the native architecture of the host. However, the default `ARCHS` value chosen by "Xcode 12 Universal Apps" includes multiple architectures. Add an explicit `ARCHS` setting with value `$(NATIVE_ARCH_ACTUAL)` to tell Xcode to use the host's native architecture only. Fixes: #20893
* | Visual Studio: Add Android supportKyle Edwards2020-06-241-4/+25
|/
* Merge branch 'backport-cuda-default-runtime' into cuda-default-runtimeBrad King2020-05-221-1/+5
|\
| * CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchainRobert Maynard2020-05-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0d0145138f (CUDA: Add abstraction for cuda runtime selection, 2019-11-29, v3.17.0-rc1~83^2) we add CUDA runtime library selection flags by default. To maintain backwards compatibility the default CUDA runtime library needs to be computed based on what libraries are found on the initial compiler invocation. For example a toolchain could establish initial flags that have all CUDA compilations using the runtime version, and if we don't detect this we will try to link to both the static and shared runtime. Co-Author: Brad King <brad.king@kitware.com> Fixes: #20708
| * Merge topic 'vs-clangcl' into release-3.17Brad King2020-03-271-1/+3
| |\ | | | | | | | | | | | | | | | | | | f3d7a15010 VS: Fix ClangCL toolset compiler path detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4523
* | \ Merge topic 'vs-clangcl'Brad King2020-03-271-1/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | f3d7a15010 VS: Fix ClangCL toolset compiler path detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4523
| * | VS: Fix ClangCL toolset compiler path detectionBrad King2020-03-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 3c125c6de0 (VS: Support Visual Studio Clang Toolkit identification, 2019-12-03, v3.17.0-rc1~341^2) using `-T ClangCL` would work but `CMAKE_{C,CXX}_COMPILER` would be detected as `cl.exe` even though `clang-cl.exe` is the actual compiler. That commit attempted to fix the detection by using `$(ClangClExecutable)` as we do for LLVM-distributed toolsets, but that is not actually defined. Instead, look for `$(CLToolExe)` in the `PATH`. Fixes: #20504
* | | Merge topic 'nmc-cl-showincludes'Brad King2020-03-271-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 6c7e6b1e49 Ninja Multi-Config: Fix MSVC showincludes prefix detection Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !4526
| * | Ninja Multi-Config: Fix MSVC showincludes prefix detectionBrad King2020-03-261-1/+1
| |/ | | | | | | | | | | Activate the detection logic for this generator too. Fixes: #20506
* | ASM: Record vendor-specific output matched to identify assemblerBrad King2020-03-121-0/+1
| | | | | | | | | | | | For example, with GNU `as`, we match `GNU assembler`, but with GNU `gcc` as the assembler, we do not match anything. Distinguishing these cases may be useful for constructing assembler command lines.
* | CMakeDetermineCompilerId: Set locale to C for vendor output matchBrad King2020-03-121-0/+13
|/ | | | | | Apply the change from commit d751d2d2ed (CMakeDetermineCompilerABI: set locale to C for try_compile(), 2019-01-14, v3.14.0-rc1~108^2~1) to the `CMAKE_DETERMINE_COMPILER_ID_VENDOR` implementation too.
* CUDA: MSVC generators fill CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIESRobert Maynard2020-01-101-1/+2
| | | | | | Fixes #18733 Correct an oversight where the MSVC generators didn't populate CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.
* Merge topic 'backport-3.16-vs-v142-version'Brad King2019-12-131-3/+4
|\ | | | | | | | | | | | | | | | | 2f853eec3d Merge branch 'backport-3.15-vs-v142-version' into backport-3.16-vs-v142-version d8d4924d98 VS: Fix support for v142 toolset minor versions in VS 16.5+ 07612646fe VS: Fix support for v142 toolset minor versions in VS 16.5+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4133
| * VS: Fix support for v142 toolset minor versions in VS 16.5+Brad King2019-12-121-3/+4
| | | | | | | | | | | | | | | | | | | | The fix in commit 5117389931 (VS: Fix support for v142 toolset minor versions, 2019-10-01, v3.16.0-rc1~32^2) worked around a bug in VS's placement of toolset files. VS 16.5 will fix that bug and restore the original pattern for locations of toolset files. Update our logic to look for both possibilities. Issue: #19779
* | VS: Support Visual Studio Clang Toolkit identificationJustin Goshi2019-12-051-1/+1
| | | | | | | | | | Teach CMake that the `ClangCl` toolset uses the `ClangClExecutable` value as the path to the compiler executable.
* | XL: Add support for Ninja and XL FortranBrad King2019-11-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ninja generator's support for Fortran requires that source files be preprocessed explicitly first. However, the `xlf` compiler does not have a simple `-E` option or equivalent to do preprocessing. The only documented way to get preprocessed output is to use `-d` to leave it behind, but only at an inflexible location. Instead, create our own `cpp` wrapper script and substitute it for the real preprocessor using `-tF -B ...`. Teach the wrapper to map the `cpp` output to the location we need and then invoke the real `cpp` underneath. Fixes: #19450
* | VS: Propagate CMAKE_VS_GLOBALS into compiler id projectsAlexander Boczar2019-10-171-0/+6
| | | | | | | | Issue: #19708
* | VS: Add support to override VCTargetsPath through toolsetAlexander Boczar2019-10-151-0/+3
|/ | | | Fixes: #19708
* Merge topic 'vs-v142-version'Brad King2019-10-021-1/+7
|\ | | | | | | | | | | | | 5117389931 VS: Fix support for v142 toolset minor versions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3874
| * VS: Fix support for v142 toolset minor versionsBrad King2019-10-011-1/+7
| | | | | | | | | | | | | | | | When using `-T v142,version=14.22` the `.props` file location is different starting with version `14.20` than it was in `14.16` and below. Adapt the path based on the version. Fixes: #19779