summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * | | QNX: Add support for CMAKE_SYSROOTStephen Kelly2020-01-271-0/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCC is a wrapper around GCC, but it is not a fully transparent wrapper. Some compile options need to be passed to GCC using a `-Wc` option. QCC does not support --sysroot, so setting CMAKE_SYSROOT in a toolchain file currently does not work. This means that it is likely that no one is setting CMAKE_SYSROOT in existing QNC toolchain files. Override the GCC option for sysroot in the QCC.cmake file with -Wc,-isysroot. This exposes a further issue in that the QNX SDK does not follow the same architectural folder structure as linux uses. That is, on linux systems, architecture-specific libraries might be in <sysroot>/usr/lib/<arch> such as /usr/lib/x86_64-linux-gnu/libcurl.so CMake models this by suffixing the <arch> onto lib directories when searching for libraries. The QNX SDK is structured differently such that the <arch> should be used as a prefix: <sysroot>/<arch>/usr/lib such as <sysroot>/x86_64/usr/lib/libcurl.so Add a variable for platform configuration to set whether to prefix or suffix the <arch> and set that in the QCC.cmake. Use the directory structure of the QNX SDK to compute the <arch> from the implicit library directories. The assumption is that the arch will be a single directory directly below the CMAKE_SYSROOT, below which the usr/ prefix occurs. It would not be appropriate to instruct users to make the <arch> part of the sysroot when specified in the toolchain file because: 1. That would be non-DRY - The QCC wrapper already determines the <arch> by the -V argument passed to the compiler, specified in the toolchain file as the CMAKE_C_COMPILER_TARGET variable. 2. The includes in the QNX SDK are not below the <arch> directory. So, the location of the <arch> in the full path is different on QNX compared to, say an embedded linux platform, but the intent is the same. Add documentation to recommend the use of CMAKE_SYSROOT in a QNX toolchain file. As the CMAKE_SYSROOT is always the same for QNX, it would be possible to simply set it in QCC.cmake. However, that would change behavior for existing users as when CMAKE_SYSROOT is set, files/paths outside of the CMAKE_SYSROOT do not get found. The <arch> prefixing is only enabled in cmSearchPath.cxx if CMAKE_SYSROOT is set. This ensures that the user gets consistency in the current state without CMAKE_SYSROOT, and gets better consistency when using CMAKE_SYSROOT.
* | | CUDA: Add abstraction for cuda runtime selectionRobert Maynard2020-01-271-0/+5
|/ / | | | | | | | | Fixes #17559 Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
* | Merge topic 'nag-submodule'Brad King2020-01-161-0/+2
|\ \ | | | | | | | | | | | | | | | | | | f7f60ddcf9 Fortran: Add support for NAG Fortran submodules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4229
| * | Fortran: Add support for NAG Fortran submodulesNeil Carlson2020-01-151-0/+2
| | | | | | | | | | | | | | | | | | They use a `.sub` extension. Fixes: #20220
* | | Merge topic 'objc-visibility-inlines'Brad King2020-01-133-7/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 7347e2f830 ObjC: Add VISIBLITY_INLINES_HIDDEN support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4199
| * | | ObjC: Add VISIBLITY_INLINES_HIDDEN supportCristian Adam2020-01-103-7/+5
| |/ / | | | | | | | | | Fixes: #20193
* | | CUDA: Fix compiler option version checks for nvcc 10.2.19Raul Tambre2020-01-031-2/+2
| | |
* | | CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) supportRobert Maynard2019-12-102-6/+63
| | |
* | | Merge topic 'cuda_updates_for_10.2'Brad King2019-12-091-0/+23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5341f5e4a1 CUDA: get header deps from compiler invocation when possible 7f15c99851 CUDA: forward unknown flags to host compiler when possible. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4099
| * | | CUDA: get header deps from compiler invocation when possibleRobert Maynard2019-11-291-0/+7
| | | | | | | | | | | | | | | | | | | | Before CUDA 10.2 `nvcc` didn't support providing header dependency information while compiling.
| * | | CUDA: forward unknown flags to host compiler when possible.Robert Maynard2019-11-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with CUDA 10.2 the nvcc compiler has gained support to automatically forward unknown flags to the host compiler. This behavior is highly desired as projcts that mix CUDA, C, C++ run into situation where flags such as `-pthread` which aren't supported by nvcc, are being applied to all source files and therefore break CUDA compilation.
* | | | Merge topic 'pch-xcode-no-warning'Brad King2019-12-052-2/+6
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | df8372da09 PCH: Do not add #pragma system_header for Xcode generator Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4098
| * | PCH: Do not add #pragma system_header for Xcode generatorCristian Adam2019-12-042-2/+6
| | | | | | | | | | | | Fixes: #20039
| * | Merge topic 'revert-FindBinUtils-ask-compiler' into release-3.16Brad King2019-11-081-16/+10
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | b2857514b0 FindBinUtils: Revert "Use the compiler to get the path to compiler tools" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4009
* | | | XL: Add support for Ninja and XL FortranBrad King2019-11-212-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge topic 'revert-FindBinUtils-ask-compiler'Brad King2019-11-081-16/+10
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | b2857514b0 FindBinUtils: Revert "Use the compiler to get the path to compiler tools" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4009
| * | | FindBinUtils: Revert "Use the compiler to get the path to compiler tools"Brad King2019-11-071-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit b2fd479df5 (FindBinUtils: Use the compiler to get the path to compiler tools, 2019-09-22, v3.16.0-rc1~51^2). The compiler's answer may incorrectly come from the `PATH`. Another approach will be needed. Fixes: #19934
* | | | Merge topic 'objc-pch'Brad King2019-11-051-0/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | e331367a89 PCH: Add support for OBJC/OBJCXX languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3983
| * | | PCH: Add support for OBJC/OBJCXX languagesCristian Adam2019-11-031-0/+2
| |/ /
* | | Refactor: Use added message types in various modulesAlex Turbov2019-11-021-3/+3
|/ / | | | | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* | IAR: Add 8051 supportMicael Borgefeldt2019-10-115-2/+19
| | | | | | | | Issue: #17264
* | IAR: Fix v850 assembler support file extensionsMicael Borgefeldt2019-10-111-1/+1
| | | | | | | | | | | | | | Fix the file extension added by commit 158f3795b8 (IAR: Add v850 assembler support, 2019-09-23, v3.16.0-rc1~70^2). Issue: #17264
* | PCH: Use clang's own pch functionality instead of the GCC emulationCristian Adam2019-10-031-0/+3
| | | | | | | | Fixes: #19786
* | Merge topic 'objective-c-cxx'Brad King2019-09-306-0/+158
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | dd0f304613 Objective C/C++: Add compiler standard detection b515af782b Help: Add release note for Objective-C/C++ language support 9e66397c28 Languages: Add support for Objective-C++ 80f120a85f Languages: Add support for Objective-C Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3811