summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Merge topic 'pch-warn-invalid'Brad King2020-03-272-4/+6
|\ \ | | | | | | | | | | | | | | | | | | 2ce08e5489 PCH: add an option to disable `-Winvalid-pch` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4499
| * | PCH: add an option to disable `-Winvalid-pch`Cristian Adam2020-03-262-4/+6
| | | | | | | | | | | | Fixes: #20295
* | | Modules: Collapse consecutive whitespace in stringsDaan De Meyer2020-03-232-2/+2
|/ /
* | Merge topic 'gnu-as'Brad King2020-03-161-0/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 9728839b9e ASM: Fix executable link lines with GNU 'as' tool as CMAKE_ASM_COMPILER 5932f0be4f ASM: Fix depfile flags for GNU 'as' tool 0d0aa98c84 ASM: Record vendor-specific output matched to identify assembler ee3ec27465 CMakeDetermineCompilerId: Set locale to C for vendor output match Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4460
| * | ASM: Fix executable link lines with GNU 'as' tool as CMAKE_ASM_COMPILERBrad King2020-03-131-0/+2
| | | | | | | | | | | | | | | The GNU `as` tool does not know how to drive linking like the C compiler does. When using `as` as the compiler, use the linker directly.
| * | ASM: Fix depfile flags for GNU 'as' toolBrad King2020-03-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The GNU `as --help` shows `--MD <file>` as an option to generate depfiles as needed by Ninja. There is no `-MT <target>` flag but fortunately the generated files automatically account for the `-o <obj>` flag. Issue: #20426
* | | Merge topic 'cuda_language'Brad King2020-03-131-0/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | f75bea1071 CUDA: Abstract language flag to compiler modules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4464
| * | | CUDA: Abstract language flag to compiler modulesRaul Tambre2020-03-111-0/+2
| |/ / | | | | | | | | | | | | Separate this detail out into compiler-specific modules. Required for Clang support, as it uses slightly different language flags.
* | | Merge topic 'apple-clang-flags-c++17'Brad King2020-03-122-2/+8
|\ \ \ | |/ / |/| / | |/ | | | | | | a67f2d00d8 Apple Clang: add flags for C++17 standard Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4468
| * Apple Clang: add flags for C++17 standardMarc Chevrier2020-03-122-2/+8
| |
| * Merge topic 'cuda-non-device-link' into release-3.17Brad King2020-02-251-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | 7da2c8c543 Merge branch 'backport-cuda-non-device-link' 738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !4376
* | | TI: Fix C toolchain command-linesOliver Blasius2020-03-091-2/+6
| | | | | | | | | | | | | | | Fix `armar` arguments. Fix the linker `--map_file=` argument. Enable response files.
* | | XL: Fix using Fortran modules from their output directoryBrad King2020-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The XL Fortran compiler's `-qmoddir=` flag sets the module output directory but does not add the directory to the search path for using modules. This is inconsistent with other compilers like the GNU Fortran compiler's `-J` flag that does both. In order to make these consistent, add the module output directory with a `-I` flag on the XL Fortran compiler so that it will be searched when using modules too. This fixes our `FortranModules` test's coverage of submodules on Ninja + XL. That test places module files in a subdirectory that with Ninja is not the current working directory when the compiler runs. Fixes: #20400
* | | Merge topic 'cuda-non-device-link'Brad King2020-02-251-1/+1
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 7da2c8c543 Merge branch 'backport-cuda-non-device-link' 738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !4376
| * Merge branch 'backport-cuda-non-device-link'Brad King2020-02-241-1/+1
| |\
| | * Ninja: Do not use nvcc response files with non-nvcc toolsFrancisco Facioni2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit d91b5a72cd (Ninja: Add support for CUDA nvcc response files, 2019-05-30, v3.15.0-rc1~8^2) we use NVCC's `--options-file` option to avoid long link command lines via a response file. However, for non-device linking the host tools are used and the option does not make sense. Update the logic to use `--options-file` only for device linking. Linking with the host tools already has its own logic for response files. Fixes: #19954
* | | PCH: Clang: Update PCH usage flags to include original headerSergey Larin2020-02-241-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an additional include flag to PCH usage command line to fix programs that rely on `compile_commands.json` file. Pass it to the preprocessor directly to avoid compiler driver to change it to '-include-pch'. When preprocessor is requested to preprocess a file, it tries to get the original filename from '.pch' and uses that file for preprocessing. CMake generates a '.pch' file from the '.hxx' file by passing an empty '.cxx' source file to the compiler as a compilation unit and the header file with the '-include' flag. After that, compiler puts compilation unit filename in the '.pch' as the original filename. However, CMake build system uses empty file as the source file and passes the header file using '-include-pch' flag. As a result, Clang uses the wrong file for preprocessing and produces the corrupted preprocessed file. Fixes: #20355 Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
* | Merge topic 'clang-tidy-driver-mode'Brad King2020-01-286-0/+15
|\ \ | | | | | | | | | | | | | | | | | | f6f4eb0907 clang-tidy: Add driver mode argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4208
| * | clang-tidy: Add driver mode argumentHanjiang Yu2020-01-276-0/+15
| | | | | | | | | | | | | | | | | | | | | `clang-tidy` does not infer driver mode if it is not provided with a JSON compilation database. This is exactly the way cmake launches it. Hence clang-tidy will only use the default driver mode. Add an explicit driver mode argument to avoid this.
* | | Merge topic 'QNX_CMAKE_SYSROOT'Brad King2020-01-281-0/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 32a6ab1f3b QNX: Add support for CMAKE_SYSROOT Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4277