summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* COMPILER_LAUNCHER: Add support for generator expressionsThomas Weißschuh2022-08-301-2/+4
| | | | Fixes: #23441
* Ninja Multi-Config: Deduplicate compile_commands.json for cross configsKyle Edwards2022-07-151-3/+5
| | | | | | | | compile_commands.json was being written for every permutation of cross configurations. Deduplicate so only one command is output for each configuration. Fixes: #23733
* cmNinjaTargetGenerator: write out BMI install information for the collatorBen Boeckel2022-07-061-0/+38
|
* cmNinjaTargetGenerator: write out export information for the collatorBen Boeckel2022-07-061-0/+79
| | | | | The collator will use this to know where the target's export information needs to go so that module properties may be provided.
* cmNinjaTargetGenerator: write out fileset information for the collatorBen Boeckel2022-07-061-0/+99
| | | | | The collator will use this to generate property settings for the imported targets in the build and install export sets.
* cmTarget: add support for C++ module fileset typesBen Boeckel2022-06-161-47/+45
| | | | | | | | | | | | | | | C++ modules have two variants which are of importance to CMake: - `CXX_MODULES`: interface modules (those using `export module M;`, `export module M:part;`, or `module M:internal_part;`) - `CXX_MODULE_HEADER_UNITS`: importable header units Creating C++ modules or partitions are *not* supported in any other source listing. This is because the source files must be installed (so their scope matters), but not part of usage requirements (what it means for a module source to be injected into a consumer is not clear at this moment). Due to the way `FILE_SET` works with scopes, they are a perfect fit as long as `INTERFACE` is not allowed (which it is not).
* cmNinjaTargetGenerator: expand CFGIntDir for NMCBen Boeckel2022-06-141-2/+3
|
* cmNinjaTargetGenerator: support msvc-style deps discovery for scanningBen Boeckel2022-04-271-10/+21
|
* cmNinjaTargetGenerator: add flags for scanning based on the fileset typeBen Boeckel2022-04-271-0/+52
|
* CUDA: Ninja generator generates valid compile databaseRobert Maynard2022-03-301-15/+19
| | | | | | | The ninja generator has been updated to poperly write the compile database when the CUDA language has been enabled. Fixes #23368
* Ninja: Avoid preprocessing twice with explicit Fortran_PREPROCESSPeter Hill2022-02-241-1/+2
| | | | | | Fix spurious warnings from gfortran+Ninja for preprocessing. Fixes: #23248
* cmLocalGenerator: Remove unused IncludePathStyle infrastructureBrad King2021-12-011-8/+3
| | | | | | It is unused since commit c564a3e3ff (Ninja: Always compile sources using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left behind a FIXME comment to eventually remove it.
* Merge topic 'ninja-pdb-dir'Brad King2021-11-041-1/+1
|\ | | | | | | | | | | | | | | 73b84db62d Ninja: Fix creation of Windows import library directory bd36735f65 cmNinjaTargetGenerator: Replace "their" with "there" in comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6694
| * cmNinjaTargetGenerator: Replace "their" with "there" in commentBrad King2021-11-031-1/+1
| |
* | CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATIONRobert Maynard2021-10-201-14/+20
|/ | | | | | The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION` now aren't mutually exclusive and can now be used together on the same target.
* Rename cmProp in cmValueMarc Chevrier2021-09-211-27/+27
|
* Merge topic 'iwyu-cl'Brad King2021-09-141-2/+20
|\ | | | | | | | | | | | | | | ccfe1b0b40 IWYU: Add `--driver-mode=cl` when applicable Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6511
| * IWYU: Add `--driver-mode=cl` when applicablePigeonF2021-09-101-2/+20
| | | | | | | | | | | | We already do this for `clang-tidy`. Fixes: #16554
* | cmNinjaTargetGenerator: Use short path for cmcldeps.exeWayde Reitsma2021-09-031-2/+5
|/
* Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-4/+2
|
* cmNinjaTargetGenerator: Fix scan rule PREPROCESSED_SOURCE placeholderBrad King2021-06-141-6/+12
| | | | | | | | | When running the module dependencies scan tool for for a language that does not compile the preprocessed output, we do not actually put the preprocessed output in the build graph. However, the value of `CMAKE_EXPERIMENTAL_<LANG>_SCANDEP_SOURCE` may reference the placeholder for the preprocessed source. Populate the placeholder to keep the file out of the way. In particular, do not clobber the `.ddi` file.
* cmNinjaTargetGenerator: Clarify GetScanBuildStatement conditionBrad King2021-06-141-1/+1
| | | | | Use the `compilePP` variable directly rather than relying on callers to make `compilePP == !ppFileName.empty()`.
* cmNinjaTargetGenerator: Simplify scan rule response file selectionBrad King2021-06-141-5/+1
| | | | | | Since commit 33a8e0bb09 (cmNinjaTargetGenerator: Simplify scan rule depfile selection, 2020-11-06, v3.20.0-rc1~516^2~1), the `$out` of the scan rule always matches our `.rsp` file selection, so use `$out.rsp`.
* HIP: Add language to CMakeRobert Maynard2021-06-071-1/+2
|
* Ninja: Always compile sources using absolute pathsBrad King2021-05-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ninja generator traditionally referenced source files and include directories using paths relative to the build directory if they could be expressed without a `../` sequence that leaves the build and source directories. For example, when using a `build/` directory inside the source tree, sources would be compiled as `-c ../src.c` and include directories would be referenced as `-I ../include`. This approach matches the traditional Ninja convention of using relative paths whenever possible, but has undesirable side effects such as: * Compiler diagnostic messages may not use absolute paths, making it harder for IDEs/editors to find the referenced sources or headers. * Debug symbols may not use absolute paths, making it harder for debuggers to find the referenced sources or headers. * Different results depending on the path to the build tree relative to the source tree. * Inconsistent with the Makefile generators, which use absolute paths. Switch to always using absolute paths to reference source files and include directories on compiler command lines. While alternative solutions for diagnostic messages and debug symbols may exist with specific tooling, this is the simplest and most consistent approach. Note that a previous attempt to do this in commit 955c2a630a (Ninja: Use full path for all source files, 2016-08-05, v3.7.0-rc1~275^2) was reverted by commit 666ad1df2d (Revert "Ninja: Use full path for all source files", 2017-02-24, v3.8.0-rc2~9^2) due to problems hooking up depfile dependencies on generated files. This time, the changes in commit 2725ecff38 (Ninja: Handle depfiles with absolute paths to generated files, 2021-05-19) should avoid those problems. Fixes: #13894, #17450
* cmNinjaTargetGenerator: Rename source file path lookup method for clarityBrad King2021-05-251-4/+5
| | | | | | The `GetSourceFilePath` method is meant only for compiled sources, and automatically handles converting it to a path for the Ninja build manifest. Rename the method to clarify both.
* cmNinjaTargetGenerator: Remove GetSourceFilePath call with different semanticsBrad King2021-05-251-1/+1
| | | | | Reference external object files using `ConvertToNinjaPath` directly. `GetSourceFilePath` is meant to reference source files to be compiled.
* cmNinjaTargetGenerator: Rename local variable for clarityBrad King2021-05-251-5/+5
|
* Ninja/Swift: Remove redundant calls to ConvertToNinjaPathBrad King2021-05-251-2/+1
| | | | `GetSourceFilePath` already handles converting to a Ninja path.
* cmScanDepFormat: Drop unused "outputs", "inputs", and "depends" fieldsBrad King2021-05-131-1/+1
| | | | | | | These fields are specified by our `P1689r3` paper, but are not actually needed. The dependencies of the scanning results themselves can be captured via normal depfile logic. Avoid saving this possibly-large information in the scanning results. It is not needed by later steps.
* Source: Remove unnecessary comparisons to nullptrVitaly Stakhovsky2021-05-101-1/+1
|
* Merge topic 'ninja-multi-long-command-line-config'Brad King2021-05-031-10/+15
|\ | | | | | | | | | | | | ad08f93ee4 Ninja Multi-Config: Split long command lines by config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6067
| * Ninja Multi-Config: Split long command lines by configKyle Edwards2021-04-301-10/+15
| | | | | | | | Fixes: #22123
* | cmLocalGenerator: Clarify GetIncludeFlags signatureBrad King2021-02-251-6/+8
|/ | | | | | | | | | | | | 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.
* Merge topic 'cpp-modules'Brad King2021-01-071-25/+108
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files 791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep 4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object b0fc2993e1 Treat the '.mpp' file extension as C++ code 988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors dacd93a2db ninja: De-duplicate version numbers required for ninja features 533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Acked-by: Shannon Booth <shannon.ml.booth@gmail.com> Merge-request: !5562
| * ninja: add experimental infrastructure to generate modmap files with dyndepBen Boeckel2021-01-051-4/+43
| | | | | | | | | | | | | | | | The scan step may need to output additional information for the compiler, not just the build tool. The modmap is assumed to be beside the object output. Additional refactoring may open up a channel to inform per-source paths to the dyndep rule in the future, but is not done here.
| * ninja: Add experimental infrastructure for C++20 module dependency scanningBrad King2021-01-051-20/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally enable this infrastructure through an undocumented `CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP` variable. Currently this is experimental and intended for use by compiler writers to implement their scanning tools. Warn as such when the feature is activated. Later when compilers provide the needed scanning tools we can enable this variable from our corresponding compiler information modules. It is never meant to be set by project code. When enabled, generate a build graph similar to what we use for Fortran module dependencies. There are some differences needed because we can scan dependencies without explicit preprocessing, and can directly compile the original source afterward. Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
| * cmNinjaTargetGenerator: use $OBJ_FILE for the objectBen Boeckel2021-01-051-1/+1
| | | | | | | | This will not be $out in all cases in the future.
* | 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-18/+22
|/ | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* 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 'correct_ispc_path_computation'Brad King2020-12-081-6/+9
|\ \ | |/ | | | | | | | | | | | | 9af93fef11 ISPC: Handle OBJECT sources in different directories 72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5581
| * ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY locationRobert Maynard2020-12-071-6/+9
| |
* | Merge topic 'explicit-LANGUAGE-flag'Brad King2020-12-041-1/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | 48aac247e9 Compile with explicit language flag when source LANGUAGE property is set 2e67a75acd Embarcadero: Simplify addition of -P flag for C++ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5522
| * | Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Ninja Generators: Homogenize configuration with MakefilesMarc Chevrier2020-12-011-38/+26
|/ / | | | | | | | | * Use same configuration variables to configure dependencies * Abstract Ninja deps format from compiler one
* | Refactoring: Introduce place-holder for dependency target.Marc Chevrier2020-11-281-2/+3
| | | | | | | | | | | | | | | | These changes are in preparation of compiler generated dependencies support for Makefiles generators * compiler output and dependency target can be different for Makefiles generators * resolve inconsistency naming for dependency file place-holder
* | Merge topic 'revert-explicit-LANGUAGE-flag'Brad King2020-11-201-10/+1
|\ \ | |/ | | | | | | | | | | 30aa715fac Revert "specify language flag when source LANGUAGE property is set" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5519