summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* HIP: Add language to CMakeRobert Maynard2021-06-071-1/+2
|
* Merge topic 'fix-compile-db-crash'Brad King2021-05-291-2/+5
|\ | | | | | | | | | | | | 316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6173
| * Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile ruleBrad King2021-05-281-2/+5
| | | | | | | | | | | | | | | | | | | | Extend the fix from commit 67e2130c96 (Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule, 2020-11-20, v3.19.1~8^2) to work for the `<FLAGS>` placeholder too. Also fix the test case to actually enable `EXPORT_COMPILE_COMMANDS` on the test target. Fixes: #22261
* | cmOutputConverter: Adopt relative path conversion helpersBrad King2021-05-171-10/+2
| | | | | | | | Move them up from cmLocalGenerator and out of cmStateDirectory.
* | cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-71/+42
| | | | | | | | | | | | Most calls to `MaybeConvertToRelativePath` use one of our common work directories (e.g. top of the build tree) as the local path. Add helpers for each of the common cases to simplify and clarify call sites.
* | cmMakefileTargetGenerator: Clarify name of relative path conversion helperBrad King2021-05-131-6/+6
| |
* | Source: Remove unnecessary comparisons to nullptrVitaly Stakhovsky2021-05-101-1/+1
| |
* | NMake: Use UTF-8 with BOM if supported by nmakeAmine Najahi2021-05-051-1/+2
| | | | | | | | Fixes: #21792
* | cmLocalGenerator: Simplify some GetIncludeFlag call sitesBrad King2021-02-251-3/+2
| | | | | | | | | | The path style argument is meaningful only with the Ninja generator, so drop it from call sites in Makefile and Xcode generators.
* | cmLocalGenerator: Clarify GetIncludeFlags signatureBrad King2021-02-251-3/+4
|/ | | | | | | | | | | | | Make the `config` argument non-optional so all callers must be explicit. Convert the path style argument to an enumeration to make its role clear at call sites. The path style argument is implemented by `ConvertToIncludeReference`, which was introduced with the Ninja generator by commit 5b114c9bee (Introduce a cmLocalGenerator::ConvertToIncludeReference function, 2011-09-07, v2.8.7~187^2~4). Its only purpose is to allow the Ninja generator to use relative paths in `-I` flags. Add a comment explaining this role.
* PCH: Remove restrictions for REUSE_FROM signature for MSVCCristian Adam2021-02-021-0/+4
| | | | Fixes: #20201
* Revert "PCH: Remove restrictions for REUSE_FROM signature for MSVC"Brad King2021-02-021-4/+0
| | | | | This reverts commit 9f060971411aca979807f70307d8b9fe1b43ff24. It was merged accidentally.
* PCH: Remove restrictions for REUSE_FROM signature for MSVCCristian Adam2021-02-021-0/+4
| | | | Fixes: #20201
* Makefiles: ensure transparent switch between dependencies strategiesMarc Chevrier2021-01-091-24/+39
|
* Merge topic 'export-compile-commands-per-target'Brad King2021-01-071-1/+1
|\ | | | | | | | | | | | | a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5651
| * CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per targetShannon Booth2021-01-051-1/+1
| | | | | | | | | | | | | | | | The new target property `EXPORT_COMPILE_COMMANDS` associated with the existing global variable can be used to optionally configure targets for their compile commands to be exported. Fixes: #19462
* | Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+2
|/ | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Makefiles: Add support of DEPFILE for add_custom_commandMarc Chevrier2020-12-231-0/+19
| | | | | Issue: #20286 Fixes: #21415
* Merge topic 'ispc_control_header_suffixes'Brad King2020-12-151-1/+6
|\ | | | | | | | | | | | | c9a50f3556 ISPC: Generated Headers suffix configurable with a better default Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5597
| * ISPC: Generated Headers suffix configurable with a better defaultRobert Maynard2020-12-141-1/+6
| | | | | | | | | | | | | | | | | | The target property `ISPC_HEADER_SUFFIX` and associated global variable now can control the suffix used when generating the C/C++ interoperability ISPC headers. In addition the default suffix is now "_ispc.h" which matches the common convention that the ISPC compiler team uses and recommends.
| * Merge topic 'fix-compile-db-crash' into release-3.19Brad King2020-11-231-6/+10
| |\ | | | | | | | | | | | | | | | | | | 67e2130c96 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5521
* | | Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was originally made by commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2), but it was reverted by commit 30aa715fac (Revert "specify language flag when source LANGUAGE property is set", 2020-11-19) to restore compatibility with pre-3.19 behavior. Implement the change again, but add policy CMP0119 to make this change while preserving compatibility with existing projects. Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to specify `-TP` for their MSVC-like variants because we already use the flag in `CMAKE_CXX_COMPILE_OBJECT`. Similarly for `Compiler/XL-CXX` and `Platform/Windows-Embarcadero`. Note also that this does not seem possible to implement for XL C. Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix: `1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`. It returns non-zero even with `-qsuppress=1501-218`. Co-Author: Robert Maynard <robert.maynard@kitware.com> Fixes: #14516, #20716
* | | Makefiles Generators: use compiler for dependencies generationMarc Chevrier2020-11-291-15/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Refactoring: Abstract Makefile line continuation formatMarc Chevrier2020-11-281-8/+3
| | |
* | | Refactoring: Makefiles Generators: Add support for various depends scannersMarc Chevrier2020-11-281-0/+1
| | |
* | | Merge topic 'fix-compile-db-crash'Brad King2020-11-231-6/+10
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 67e2130c96 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5521
| * | Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile ruleBrad King2020-11-201-6/+10
| | | | | | | | | | | | Fixes: #21471
* | | Merge topic 'revert-explicit-LANGUAGE-flag'Brad King2020-11-201-7/+0
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 30aa715fac Revert "specify language flag when source LANGUAGE property is set" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5519
| * | Revert "specify language flag when source LANGUAGE property is set"Brad King2020-11-191-7/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge topic 'clang-tidy-for-objc'Brad King2020-11-061-7/+13
|\ \ | | | | | | | | | | | | | | | | | | 1134064e22 clang-tidy: allow OBJC and OBJCXX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5467
| * | clang-tidy: allow OBJC and OBJCXXAndrew Fuller2020-11-051-7/+13
| | |
* | | Makefiles: Honor CMAKE_EXPORT_COMPILE_COMMANDS for ASMMaxime Girard2020-11-041-1/+1
|/ / | | | | | | | | | | Generate build command for assembly file in `compile_command.json`. Issue: #20059
* | cmLocalGenerator::GetRuleLauncher: return cmPropvvs314152020-11-021-2/+2
|/
* CUDA: Clang separable compilationRaul Tambre2020-09-241-2/+131
| | | | | | | | | | | | 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
* Makefile: Add policy CMP0113 to avoid duplication of custom commandsBrad King2020-09-081-0/+35
| | | | | | | | | | | | | | | | | Do not attach a custom command to a target if it is already attached to one of the target's dependencies. The command's output will be available by the time the target needs it because the dependency containing the command will have already been built. This may break existing projects that do not properly mark non-created outputs with the `SYMBOLIC` property. Previously a chain of two custom commands whose intermediate dependency is not created would put both commands in a dependent project's Makefile even if the first command is also in its dependency's Makefile. The first command would run twice but the build would work. Now the second command needs an explicit `SYMBOLIC` mark on its input to tell CMake that it is not expected to exist. To maintain compatibility with projects that left out the mark, add a policy activating the behavior.
* cmMakefileTargetGenerator: Simplify custom command output collectionBrad King2020-09-081-10/+3
|
* ISPC: Support generation for multiple instruction setsRobert Maynard2020-09-041-2/+16
|
* ISPC: Add compiler launcher supportRobert Maynard2020-09-031-1/+1
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-34/+40
|
* Merge topic 'ispc_lang_support'Brad King2020-09-011-2/+37
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * ISPC: Support ISPC header generation byproducts and parallel buildsRobert Maynard2020-08-281-1/+35
| |
| * Add ISPC compiler support to CMakeRobert Maynard2020-08-281-1/+2
| |
* | Add INTERFACE libraries to generated buildsystem if they have SOURCESBrad King2020-08-071-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | INTERFACE libraries were created with the intention of collecting usage requirements for use by other targets via `target_link_libraries`. Therefore they were not allowed to have SOURCES and were not included in the generated buildsystem. In practice, this has become limiting: * Header-only libraries do have sources, they just do not compile. Developers should be able to edit those sources (the header files) in their IDE. * Header-only libraries may need to generate some of their header files via custom commands. Some projects work around these limitations by pairing each interface library with an `add_custom_target` that makes the header files and custom commands appear in the generated buildsystem and in IDEs. Lift such limitations by allowing INTERFACE libraries to have SOURCES. For those with sources, add a corresponding build target to the generated buildsystem. Fixes: #19145
* Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-2/+2
|
* Merge topic 'cmnonempty'Kyle Edwards2020-07-151-10/+10
|\ | | | | | | | | | | | | eaad8072ee cmNonempty: Convenience inlines to check for non-empty string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5017
| * cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-10/+10
| |
* | cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-2/+1
|/
* Explicitly specify language flag when source LANGUAGE property is setRobert Maynard2020-06-091-0/+7
| | | | Fixes: #14516, #20716
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* Merge topic 'fortran-preprocess-property'Brad King2020-05-221-0/+1
|\ | | | | | | | | | | | | | | | | | | 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