summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\ \ \ | | |/ | |/|
| * | Intel: Add flags for C++20Brad King2020-06-261-0/+10
| | | | | | | | | | | | | | | Patch-by: Matheus Izvekov Fixes: #20880
* | | Merge topic 'armclang-typo'Brad King2020-06-181-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 2ff68c00e0 ARMClang: Fix typo in -Xlinker flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4916
| * | ARMClang: Fix typo in -Xlinker flagOsama Moharam2020-06-181-1/+1
| |/ | | | | | | | | Fix a typo from commit ef816610be (ARMClang: allow fallback to -march and correct setting of --cpu flags, 2020-06-03, v3.18.0-rc1~18^2).
* | Merge topic 'clang_cxx20'Brad King2020-06-151-1/+8
|\ \ | |/ | | | | | | | | | | | | b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17 5d26efe38f Clang: Add final C++20 flag for Clang 11.0+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4887
| * Clang: Record Clang 6.0+ as fully supporting C++17Raul Tambre2020-06-131-0/+4
| |
| * Clang: Add final C++20 flag for Clang 11.0+Raul Tambre2020-06-131-1/+4
| | | | | | | | | | -std=c++20 superseded -std=c++2a in upstream Clang commit 24ad121582454e625bdad125c90d9ac0dae948c8.
* | Merge topic 'add_explicit_lang_flag_to_compile_object_rule'Brad King2020-06-1112-3/+24
|\ \ | |/ |/| | | | | | | | | | | | | 74b1c9fc8e Explicitly specify language flag when source LANGUAGE property is set 457170a476 CXX: Compile when possible with explicit `Cxx` language flag set 644d3b86eb C: Compile when possible with explicit `C` language flag set Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4780
| * CXX: Compile when possible with explicit `Cxx` language flag setRobert Maynard2020-06-096-3/+12
| | | | | | | | Issue: #14516, #20716
| * C: Compile when possible with explicit `C` language flag setRobert Maynard2020-06-096-0/+12
| | | | | | | | Issue: #14516, #20716
* | CUDA: Teach CMake that NVCC 11 supports cuda_std_17Robert Maynard2020-06-101-0/+11
|/
* CUDA: Fix Clang depfile flags when simulating MSVCRaul Tambre2020-06-081-0/+3
| | | | | | | | | __compiler_clang() doesn't call __compiler_gnu() if we're emulating MSVC. Thus CMAKE_DEPFILE_FLAGS_CUDA remains unset and compiling doesn't work, due to NVCC dependency injection workaround in CMakeCUDAInformation.cmake, which triggers for Ninja if they're not set. Always set the depfile flags to fix this. Most other compiler modules seem to do the same.
* ARMClang: allow fallback to -march and correct setting of --cpu flagsOsama Moharam2020-06-031-10/+57
| | | | | | | allows cmake to fall back to CMAKE_SYSTEM_ARCH in case CMAKE_SYSTEM_PROCESSOR is not in armclang -mcpu=list additionally checks if CMAKE_SYSTEM_PROCESSOR belongs to armlink --cpu=list Fixes: #19962
* Merge topic 'armclang-armlink'Brad King2020-06-031-2/+14
|\ | | | | | | | | | | | | 73fb6ac82b ARMClang: Add support for armlink Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4811
| * ARMClang: Add support for armlinkOsama Moharam2020-06-021-2/+14
| | | | | | | | | | | | sets CMAKE_LIBRARY_PATH_FLAG to '--userlibpath=' when using armlink. Fixes: #20761
* | Merge branch 'backport-3.17-pch-no-Fortran' into pch-no-FortranBrad King2020-06-022-13/+17
|\ \ | |/ |/|
| * PCH: Do not enable GNU or Intel PCH settings for FortranBrad King2020-06-022-11/+15
| | | | | | | | | | | | | | | | | | The PCH settings are shared by C and CXX languages but do not make sense for Fortran. In particular, `CMAKE_PCH_EXTENSION` should not be set because it can overwrite the value set for C/C++ languages, which may have a different compiler vendor than the Fortran compiler. Fixes: #20752
* | ASM: Fix preprocessor definition flags for GNU 'as' toolKyle Edwards2020-06-011-0/+1
| | | | | | | | Fixes: #20780
* | Update links to gitlab.kitware.com repos to add `-/`Brad King2020-05-261-1/+1
| | | | | | | | | | | | GitLab now uses a `/-/` component between the `group/project` part of the URL and the `{issues,merge_requests,tree}` part so that it can support `group/subgroup/project` with arbitrary depth.
* | Merge topic 'fortran-preprocess-property'Brad King2020-05-2212-0/+37
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF 66c4e87282 Ninja: Add helper functions to generate Fortran build 5cca1ec893 Ninja: Add helper functions to generate Fortran preprocess rule b0a6161190 Fortran: Add Fortran_PREPROCESS property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4659
| * | Fortran: Add Fortran_PREPROCESS propertyPeter Hill2020-05-2112-0/+37
| | | | | | | | | | | | Issue: #18870
* | | Merge branch 'backport-cuda-default-runtime' into cuda-default-runtimeBrad King2020-05-221-1/+0
|\ \ \ | | |/ | |/|
| * | CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchainRobert Maynard2020-05-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | CUDA: Add support for Clang compilerRaul Tambre2020-05-152-0/+29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When crosscompiling we pass the sysroot. We need to try various architecture flags. Clang doesn't automatically select one that works. First try the ones that are more likely to work for modern installations: * <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for future compatibility. * <=sm_20 is removed since CUDA 9.0, try sm_30. Otherwise fallback to Clang's current default. Currently that's `sm_20`, the lowest it supports. Separable compilation isn't supported yet. Fixes: #16586
* | OpenWatcom: Organize and update C/C++ toolchain command linesJiri Malak2020-04-281-20/+22
| |
* | OpenWatcom: Move non-Windows settings to Modules/CompilerJiri Malak2020-04-283-0/+118
| | | | | | | | | | Restructure OpenWatcom toolchain support files to simplify adding of new targets DOS, OS/2 and Linux including cross-compilation.
* | Merge topic 'ti-compilers-fix-cxx'Brad King2020-04-211-2/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | 65c1320719 Compiler/TI: Fix C++ toolchain command-lines 4110d9dffb Compiler/TI: Fix linker command line for C++ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4627
| * | Compiler/TI: Fix C++ toolchain command-linesAlekseev Alexey2020-04-181-2/+5
| | | | | | | | | | | | | | | | | | Applied commit 5a0fc68312 (TI: Fix C toolchain command-lines, 2020-03-03) for C++: Fix `armar` arguments. Fix the linker `--map_file=` argument. Enable response files.
| * | Compiler/TI: Fix linker command line for C++Alekseev Alexey2020-04-181-1/+1
| | | | | | | | | | | | | | | Just like C, libraries must be in the last part of the linker. Commit 89317915d9 (Compiler/TI: Pass libraries as last part to linker, 2016-06-02)
* | | CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated to the device link step. To control which options are selected for normal link and device link steps, the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used. Fixes: #18265
* | | CUDA: Add information for LINKER: pattern translationMarc Chevrier2020-04-192-0/+18
|/ /
* | GNU: Disable depfiles in try-compile mode only for GCCRaul Tambre2020-04-071-1/+2
| | | | | | | | | | Disabling them causes issues for Clang's CUDA frontend. Since this is a GCC bug, simply check for GCC.
* | CUDA: Refactor PTX compilation flag into compiler modulesRaul Tambre2020-04-071-0/+1
| |
* | Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()Raul Tambre2020-04-073-186/+122
| | | | | | | | | | | | | | These standard flags are the same for CXX, OBJCXX and CUDA. Refactor them into a single macro to reduce duplication and so we can easily reuse them. Updated bootstrap script to search in the general Clang module instead of the language-specific.
* | Merge topic 'xl-cxx14'Brad King2020-04-011-1/+7
|\ \ | |/ | | | | | | | | | | | | 46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support 4aaa9ea96c XL: C++14 language level flags are only available on Linux Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4551
| * XL: Add comment clarifying why we pretend it has full C++11/14 supportBrad King2020-03-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Since commit b0f46c48f6 (CompileFeatures: Now able to presume full language level support, 2019-03-06, v3.15.0-rc1~265^2~1) we pretend that the XL compiler has full C++11 and C++14 support so that projects specifying granular features will at least get the corresponding compiler mode. This is a work around for our lack of a full feature check table for this compiler that works in common cases. Add a comment explaining this. Issue: #20521
| * XL: C++14 language level flags are only available on LinuxBrad King2020-03-311-1/+1
| | | | | | | | | | | | | | | | Since commit 458ea9d76c (XL: Add C++14 language level flags, 2019-04-15, v3.15.0-rc1~226^2) we use `-qlanglvl=extended1y` for C++14 with XL 16.1. However, that flag is only supported on a Linux host. Issue: #20521