summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'ispc-system-includes' into release-3.19Brad King2020-12-101-2/+0
|\ | | | | | | | | | | | | 8da25e4a3c ISPC: Treat system includes as '-I' includes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5591
| * ISPC: Treat system includes as '-I' includesRobert Maynard2020-12-091-2/+0
| | | | | | | | ISPC doesn't have specific syntax for system includes.
* | Revert "Intel: Add Intel DPC++ compiler identification"Brad King2020-12-071-7/+0
| | | | | | | | | | | | | | | | | | | | Revert commit 887f3a88a6 (Intel: Add Intel DPC++ compiler identification, 2020-09-21, v3.19.0-rc1~124^2). The compiler has already been released, and is more usable with CMake by pretending to be upstream Clang than by identifying it as a compiler for which we have not implemented support. Fixes: #21551
* | Revert "Intel: Add Intel Clang compiler identification"Brad King2020-12-071-7/+0
| | | | | | | | | | | | | | | | | | | | Revert commit 5c3a93ab88 (Intel: Add Intel Clang compiler identification, 2020-09-29, v3.19.0-rc1~68^2). The compiler has already been released, and is more usable with CMake by pretending to be upstream Clang than by identifying it as a compiler for which we have not implemented support. Issue: #21551
* | Compiler/TI: Fix C standard flags in C-only projectAdam Weisi2020-12-011-3/+3
| | | | | | | | Use our compiler architecture variable for C rather than CXX.
* | Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}FlagRobert Maynard2020-11-251-1/+0
|/ | | | | | | | Rename the `CheckPIESupported` helper functions so that they don't clobber other internal functions. Also rename them to document they can't be unified with `CheckCompilerFlag`. Fixes: #21497
* Revert "specify language flag when source LANGUAGE property is set"Brad King2020-11-1912-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup tables from its two immediate ancestors. The purpose of that change was to convert an explicit `LANGUAGE` source file property into an explicit language specification compiler flag like `-x c`. This seems reasonable since the property is documented as meaning "indicate what programming language the source file is". It is also needed to help compilers deal with non-standard source file extensions they don't recognize. However, some projects have been setting `LANGUAGE C` on `.S` assembler source files to mean "use the C compiler". Passing `-x c` for them breaks the build because the `.S` sources are not written in C. These projects should be updated to use `enable_language(ASM)`, for which CMake often chooses the C compiler as the assembler when using toolchains that support it (which would have to be the case for projects using the approach). Revert the change for now to preserve the old behavior for such projects. We can re-introduce it with a policy in a future version of CMake. Fixes: #21469 Issue: #14516, #20716
* CUDA: Enable support on QNXjanbernloehr2020-11-021-1/+1
| | | | | | | | | | | This fixes the following two issues with the CUDA support on QNX: * cuda target name is not derived correctly (should be `aarch64-qnx`). * linking `cudart` must not be linked against `rt`, `dl`, `pthread`. This enables to use cmake's native cuda support on QNX. Fixes: #21381
* Merge topic 'correct_msvc_cuda_flag_warning' into release-3.19Brad King2020-10-271-4/+11
|\ | | | | | | | | | | | | 2b0d3c3524 CUDA: Use MSVC version to determine supported C++ standard levels Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5423
| * CUDA: Use MSVC version to determine supported C++ standard levelsRobert Maynard2020-10-261-4/+11
| | | | | | | | Fixes: #21335
* | IAR: Use .o object file extension with IAR-Ilink toolchainsFelipe Torrezan2020-10-151-0/+1
|/ | | | | The compiler default extension for its objects is `.o`. Prefer that over `.obj`.
* Intel: Add Intel Clang compiler identificationHarini Chilamantula2020-09-291-0/+7
| | | | | The compiler identifies itself with the `__INTEL_CLANG_COMPILER` preprocessor definition.
* CUDA: Clang separable compilationRaul Tambre2020-09-242-0/+2
| | | | | | | | | | | | For NVCC the compiler takes care of device linking when passed the "-dlink" flag. Clang doesn't support such magic and requires the buildsystem to do the work that NVCC does behind the scenes. The implementation is based on Bazel's device linking documentation: https://github.com/tensorflow/tensorflow/blob/7cabcdf073abad8c46e9dda62bb8fa4682d2061e/third_party/nccl/build_defs.bzl.tpl#L259 Closes: #20726
* Intel: Add Intel DPC++ compiler identificationHarini Chilamantula2020-09-221-0/+7
| | | | | The compiler identifies itself with the `__INTEL_DPCPP_COMPILER__` preprocessor definition.
* Compiler/TI: Add std options for C++14Josef Angstenberger2020-09-201-4/+22
| | | | | The TI compiler does either support C++98 or C++14, but not both at the same time.
* Compiler/TI: Add std options for C++98Josef Angstenberger2020-09-201-0/+51
| | | | | | | | The TI compiler does not support C++98, only C++03 (based on manual of current version). This change sets the C++98 option to C++03 based on the fact that it is done this way for the SunPro compiler already.
* Compiler/TI: Add std options for C11Josef Angstenberger2020-09-201-0/+11
|
* Compiler/TI: Check default C standardJosef Angstenberger2020-09-202-0/+19
|
* Compiler/TI: Check compiler version for C99 supportJosef Angstenberger2020-09-201-4/+35
|
* Compiler/TI: Fix definition of std optionsJosef Angstenberger2020-09-201-4/+4
| | | | | | | | - The compile option variable has to be defined as list. - The compiler works in relaxed ANSI mode by default. Strict ANSI has to be explicitly set additionally to the language standard.
* Compiler/TI: Avoid generic variable name in macroJosef Angstenberger2020-09-201-8/+7
| | | | | | | | | | In commit a548a52230 (Compiler/TI: Refactor C/CXX to use a common file, 2020-07-11) a variable named `prefix` has been introduced. It is set in the callers namespace because it was defined inside a macro, not a function. Avoid such generic variable name.
* Clang: use -imsvc for system include dirs when running on WindowsAndrew Fuller2020-09-161-0/+1
| | | | Fixes #17808
* Merge topic 'armclang-fixes'Brad King2020-09-111-2/+3
|\ | | | | | | | | | | | | | | 3d1ed986e2 ARMClang: Fix link line generation after addition of armlink support Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Osama Moharam <osama.moharam.uw@renesas.com> Merge-request: !5211
| * ARMClang: Fix link line generation after addition of armlink supportMarc Chevrier2020-09-101-2/+3
| | | | | | | | | | | | | | Revise logic added by commit 73fb6ac82b (ARMClang: Add support for armlink, 2020-06-02, v3.18.0-rc1~27^2). Fixes: #21154
* | Merge topic 'pch-instantiate-templates'Brad King2020-09-101-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 8c8f03422e PCH: Template instantiation support Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Acked-by: Cristian Adam <cristian.adam@gmail.com> Tested-by: Raul Tambre <raul@tambre.ee> Merge-request: !5168
| * | PCH: Template instantiation supportTobias Hieta2020-09-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template instantiation in precompiled headers. Enabled by default. Currently only supported for Clang 11 and newer. Implements #21133.
* | | Merge topic 'ios-pch-x-lang-header'Brad King2020-09-091-1/+6
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5188
| * | PCH: Mark CMake PCH source files as -x <lang>-headerCristian Adam2020-09-041-1/+6
| | | | | | | | | | | | Fixes: #21163
| * | Merge topic 'cuda-std-for-msvc' into release-3.18Brad King2020-08-261-4/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | bed315a0da CUDA: Support setting CUDA14/17 when using MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5160
* | | | ARMClang: Pass defines to assemblerHugues Kamba2020-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | This is useful when the assembly file(s) is passed to the pre-processor.
* | | | Merge topic 'ispc_lang_support'Brad King2020-09-011-0/+22
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image 8976817d6d ISPC: Update help documentation to include ISPC 2368f46ba4 ISPC: Support building with the MSVC toolchain e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 34cc6acc81 Add ISPC compiler support to CMake 419d70d490 Refactor some swift only logic to be re-used by other languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5065
| * | | Add ISPC compiler support to CMakeRobert Maynard2020-08-281-0/+22
| | | |
* | | | Merge topic 'cuda-std-for-msvc'Brad King2020-08-261-4/+6
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | bed315a0da CUDA: Support setting CUDA14/17 when using MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5160
| * | | CUDA: Support setting CUDA14/17 when using MSVCRobert Maynard2020-08-241-4/+6
| | | | | | | | | | | | | | | | Fixes #20953
* | | | Merge topic 'msvc_static_assert'Brad King2020-08-252-3/+5
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 95bc11dbb4 MSVC: Record support for c_static_assert Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5148
| * | | MSVC: Record support for c_static_assertRaul Tambre2020-08-202-3/+5
| |/ / | | | | | | | | | Supported since MSVC 19.28.29115 (VS 16.8.0 Preview 1.0).
* | | Merge topic 'msvc_c11'Brad King2020-08-122-12/+33
|\ \ \ | |/ / | | / | |/ |/| | | | | f7347f28c7 MSVC: Record support for C11 and c_restrict Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5115
| * MSVC: Record support for C11 and c_restrictRaul Tambre2020-08-112-12/+33
| | | | | | | | | | | | | | MSVC >=19.27 supports a C11 switch. The `c_restrict` feature has also been implemented. Fixes: #21069
* | Merge topic 'clang-msvc-cxx-std'Brad King2020-07-301-5/+5
|\ \ | |/ | | | | | | | | | | | | 21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !5082
| * Clang: Fix fallback compile features when simulating old MSVC versionsBrad King2020-07-291-5/+5
| | | | | | | | | | | | | | | | Refactoring in commit 25439c7d62 (Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards(), 2020-03-16, v3.18.0-rc1~362^2~4) accidentally broke the `cxx_std_*` fallback feature names. Issue: #21033
| * Merge topic 'intel-c++20' into release-3.18Brad King2020-06-291-0/+10
| |\ | | | | | | | | | | | | | | | | | | 99c8dbf497 Intel: Add flags for C++20 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4946
* | \ Merge topic 'pgi-no-A'Brad King2020-07-231-4/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 52eee19389 PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Chuck Atkins <chuck.atkins@kitware.com> Merge-request: !5025
| * | | PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFFTin Huynh2020-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 9b97cb5562 (PGI: Add language standards for PGI, 2017-05-01, v3.9.0-rc1~174^2), we have passed the `-A` flag to the PGI C++ compiler when specifying a C++ standard flag with compiler extensions turned off. The flag is not meant for that. The PGI C++ standard flags do not turn extensions on by default and have a separate `--gnu_extensions` flag for that which we already use when CXX_EXTENSIONS is ON. Simply drop the `-A` flag. Fixes: #20997
* | | | Fix typos identified using codespellJean-Christophe Fillion-Robin2020-07-222-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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,\ " ```
* | | Compiler/TI: Avoid response file usage for linkerJosef Angstenberger2020-07-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object and library files have to be listed after the `--run-linker` flag. But after this flag the `--cmd_file` flag for response files cannot be used any more. Putting the whole command line into a response file would work, but this is not supported by CMake (yet).
* | | Compiler/TI: Add compiler flags to linkerJosef Angstenberger2020-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By adding the compiler flags via `<FLAGS>` to the linker call, the linker can decide which default library to use. CMake replaces `<FLAGS>` by the content of `CMAKE_<LANG>_FLAGS`. So any relevant flag needs to be defined in this variable, preferably in a toolchain file. The compiler flags have to be specified before the `--run_linker` flag and the linker flags afterwards. Replaces Merge-request !4890
* | | Compiler/TI: Avoid usage of ranlibJosef Angstenberger2020-07-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a ranlib executable has been found it is used for finishing an archive. In case of the TI compiler the archive file gets corrupted. Fixes: #14876
* | | Compiler/TI: Sync ASM settings to C/CXXJosef Angstenberger2020-07-141-6/+2
| | | | | | | | | | | | | | | | | | For assembler the same compiler executable is used as for C/CXX. So the setting shall be kept in sync.
* | | Compiler/TI: Refactor C/CXX to use a common fileJosef Angstenberger2020-07-143-31/+39
| | |
* | | Merge branch 'backport-intel-c++20' into intel-c++20Brad King2020-06-261-0/+10
|\ \ \ | | |/ | |/|