summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Link step: use linker dependency linker fileMarc Chevrier2023-05-031-0/+2
| | | | | | Based on work done by @ben.boeckel (!8051) Fixes: #22217
* Merge topic 'ninja-performance'Brad King2023-03-301-8/+4
|\ | | | | | | | | | | | | | | 426f3295f6 Ninja: Use more efficient data structures to collect outputs Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8371
| * Ninja: Use more efficient data structures to collect outputsNicolas van Kempen2023-03-281-8/+4
| |
* | Merge topic 'mingw-slashes'Brad King2023-03-281-1/+1
|\ \ | |/ |/| | | | | | | | | | | a67cd9c39c Ninja: Restore slash style for MinGW tools when extra languages are enabled Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8368
| * Ninja: Restore slash style for MinGW tools when extra languages are enabledBrad King2023-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | Since commit f3ca199c9b (cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows, 2023-03-18, v3.26.1~2^2~6), we accidentally "unrecognize" MinGW tools on Windows if a language other than C or CXX is enabled. This causes the wrong slash style to be generated in paths in `build.ninja`. Fixes: #24642
* | Merge topic 'clang-windows-cxx-modules'Brad King2023-03-211-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end 6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows 8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8346
| * cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on WindowsBrad King2023-03-181-0/+1
| |
* | Merge topic 'revert-optimize-target-depends-closure'Brad King2023-03-131-2/+6
|\ \ | |/ | | | | | | | | | | 685108a582 Ninja: Revert "Optimize target depends closure" due to performance regression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8315
| * Ninja: Revert "Optimize target depends closure" due to performance regressionBrad King2023-03-101-2/+6
| | | | | | | | | | | | Revert commit 1f16af01f4 (cmGlobalNinjaGenerator: Optimize target depends closure, 2023-01-17, v3.26.0-rc1~74^2). It regressed generation time for some projects. Revert it pending further investigation.
* | cmGlobalNinjaGenerator: Remove unused memberBrad King2023-02-071-1/+0
|/ | | | | | | | The `DisableCleandead` member was added by commit c5011399c5 (Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies, 2020-11-10, v3.19.0~15^2) but has not been used since commit 1144d25094 (Merge branch 'backport-ninja-no-cleandead' into ninja-no-cleandead, 2020-12-14, v3.19.2~4^2). Remove it.
* Ninja: require Ninja 1.11 for C++ module supportBen Boeckel2023-01-231-2/+4
| | | | | See: https://gitlab.kitware.com/cmake/cmake/-/issues/18355#note_1296721 See: https://github.com/ninja-build/ninja/pull/1937
* cmGlobalNinjaGenerator: Optimize target depends closurePierre Testart2023-01-171-6/+2
| | | | | | | | | | Rewrite AppendTargetDependsClosure method to only cache local target outputs, not including outputs from dependencies. Caching all recursive target outputs causes much time to be spent merging sets that have many elements in common (from targets that are included through multiple dependency paths). It is faster to always iterate over all dependencies instead.
* cmDyndepCollation: factor out parsing dyndep informationBen Boeckel2022-11-301-2/+2
|
* cmGlobalGenerator: factor out C++ module support checkingBen Boeckel2022-11-231-2/+2
| | | | This will simplify adding support to other generators.
* Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entryAlex Turbov2022-11-171-3/+2
| | | | | | | | | | Before, a documentation entry was in/out parameter. Now it's a normal return value. This also makes possible to eliminate defaulted default ctor for `cmDocumentationEntry` for C++ 11. Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
* EXPORT_COMPILE_COMMANDS: add `output` fieldBen Boeckel2022-10-281-1/+2
| | | | | | | | Also write for all configurations from multi-config generators. This field was added in the Clang 5 documentation and not present in the Clang 4 documentation (sometime between Dec 2016 and Mar 2017 according to `web.archive.org`).
* Merge topic 'ninja-intl-paths'Brad King2022-10-271-1/+0
|\ | | | | | | | | | | | | | | a12050666c Tests: Add case for ninja with non-ascii chars 02a04dd9c7 Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7833
| * Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10Brad King2022-10-261-1/+0
| | | | | | | | | | | | | | | | Revert commit bbdb000c55 (GlobalNinjaGenerator: enlarge file stream buffer, 2022-01-25, v3.23.0-rc1~68^2). Somehow `rdbuf()->pubsetbuf()` is resetting our imbued locale and `cm_codecvt` that handles encoding. Fixes: #24089
* | cmGlobalNinjaGenerator: verify generated objects against filesetsBen Boeckel2022-07-061-1/+3
|/
* Merge topic 'enlarge-build-file-stream-buffer'Brad King2022-01-271-0/+1
|\ | | | | | | | | | | | | bbdb000c55 GlobalNinjaGenerator: enlarge file stream buffer Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6903
| * GlobalNinjaGenerator: enlarge file stream bufferClemens Wasser2022-01-261-0/+1
| |
* | Merge topic 'encode-literal-inplace'Brad King2022-01-271-0/+1
|\ \ | | | | | | | | | | | | | | | | | | 5c3f188bef GlobalNinjaGenerator: Add EncodeLiteralInplace which doesn't copy Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6904
| * | GlobalNinjaGenerator: Add EncodeLiteralInplace which doesn't copyClemens Wasser2022-01-251-0/+1
| |/
* | cmBuildOptions: Split build arguments into separate object.Carsten Rudolph2022-01-221-1/+3
|/
* Ninja Multi-Config: Fix cross-config custom command dependency tracingBrad King2021-11-041-2/+0
| | | | | | Process `CMAKE_CROSS_CONFIGS` and friends to properly configure the generator for cross-config behavior before custom command dependency tracing.
* Ninja: Use `ccmake` for `edit_cache`NAKAMURA Takumi2021-06-291-1/+0
| | | | | If `ninja` is new enough to support the console pool, and `ccmake` is available, use it for `edit_cache`.
* cmGlobalCommonGenerator: Adopt GetEditCacheTargetNameNAKAMURA Takumi2021-06-291-1/+0
| | | | The implementation is the same for both Makefile and Ninja generators.
* cmGlobalCommonGenerator: Add SupportsDirectConsoleNAKAMURA Takumi2021-06-291-1/+1
| | | | | Default to `true` since this is used by Makefile generators. The Ninja generator already overrides it to use a version check.
* cmGlobalNinjaGenerator: Rename SupportsConsolePool to SupportsDirectConsoleNAKAMURA Takumi2021-06-291-1/+1
| | | | Use a name that is not ninja-specific.
* cmGlobalNinjaGenerator: Add helper to compute absolute paths for build.ninjaBrad King2021-05-251-0/+1
|
* Ninja: Handle depfiles with absolute paths to generated filesBrad King2021-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Ninja treats every (normalized) path as its own node. It does not recognize `/abs/path/to/file` in a depfile as matching `path/to/file` even when `build.ninja` and the working directory are in `/abs/`. See Ninja Issue 1251. In cases where we pass absolute paths to the compiler, it will write a depfile containing absolute paths. If those files are generated in the build tree by custom commands, `build.ninja` references them by relative path in build statement outputs, so Ninja does not hook up the dependency and rebuild the project correctly. Add infrastructure to work around this problem by adding implicit outputs to custom command build statements that reference the main outputs by absolute path. Use a `${cmake_ninja_workdir}` placeholder to avoid repeating the base path. For example: build out.txt | ${cmake_ninja_workdir}out.txt: CUSTOM_COMMAND ... Ninja will create two nodes for the output file, one with a relative path and one with an absolute path. A depfile may then mention either form of the path and Ninja will hook up the dependency. Unfortunately Ninja will also stat the file twice. Issue: #13894 Fixes: #21865
* cmGlobalNinjaGenerator: Factor out custom command output collectionBrad King2021-05-191-1/+14
| | | | | | De-duplicate code paths calling ConvertToNinjaPath and SeenCustomCommandOutput on custom command outputs and custom target byproducts.
* cmGlobalNinjaGenerator: Reduce string copies in WriteCustomCommandBuildBrad King2021-05-191-7/+9
| | | | | Re-order arguments to group those with similar roles. Use move semantics to avoid copying vectors of strings.
* Ninja: Use new wincodepage tool to determine encodingKyle Edwards2021-03-091-0/+5
| | | | | | | | Ninja 1.11 and later uses UTF-8 on Windows when possible, and includes a tool that reports the code page in use. Use this tool to determine what encoding to write the Ninja files in. Fixes: #21866
* Ninja Multi-Config: Enable relink diagnostic messageBrad King2021-02-031-0/+2
| | | | | We already have a message for the "Ninja" generator, but it applies to the "Ninja Multi-Config" generator too.
* clang-tidy: fix `readability-redundant-access-specifiers` warningsBen Boeckel2021-01-271-2/+0
|
* Merge topic 'cpp-modules'Brad King2021-01-071-9/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+7
| | | | | | | | | | | | | | | | 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-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-2/+5
|/ | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Merge topic 'custom-command-output-genex-nmc'Brad King2020-12-161-3/+42
|\ | | | | | | | | | | | | | | | | | | | | | | 1526ae3aba Tests: Add cases for Ninja Multi-Config cross-config custom commands dcf9f4d2f7 Ninja Multi-Config: Add support for cross-config custom commands 15467f12f7 cmLocalGenerator: Adopt custom target 'force' output name generation 7b64b0cd5a cmLocalGenerator: Refactor custom command generator construction d29da8ed3e cmMakefile: Simplify custom target 'force' output name generation 2b1cc175ee Help: Clarify version adding add_custom_{command,target} OUTPUT genex support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5612
| * Ninja Multi-Config: Add support for cross-config custom commandsKyle Edwards2020-12-151-3/+42
| | | | | | | | Co-Author: Brad King <brad.king@kitware.com>
* | Merge topic 'ninja-no-cleandead'Brad King2020-12-151-2/+0
|\ \ | |/ |/| | | | | | | | | | | 1144d25094 Merge branch 'backport-ninja-no-cleandead' into ninja-no-cleandead 73a961eaba Ninja: Remove cleandead on regeneration Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5614
| * Merge branch 'backport-ninja-no-cleandead' into ninja-no-cleandeadBrad King2020-12-141-2/+0
| |\
| | * Ninja: Remove cleandead on regenerationBrad King2020-12-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the `cleandead` tool invocation added by commit fb18215904 (Ninja: clean ninja metadata once generated, 2019-05-13, v3.17.0-rc1~207^2). The tool deletes files that were not previously deleted by regenerating the build system. Also, there are use cases where no-longer-generated files should not be removed, such as Qt's TS files. Fixes: #21549
* | | Merge topic 'ninja-regen-metadata'Brad King2020-12-011-0/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | 73d1c78bf4 ci: update to use ninja 1.10.2 11f4259362 Ninja: Clean metadata after regen during build on Windows with 1.10.2+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5555
| * | Ninja: Clean metadata after regen during build on Windows with 1.10.2+Brad King2020-11-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ninja 1.10.2 fixes support for `generator = 1` rules that run metadata update commands during regeneration while a build is running. Update the condition added by commit ccaa0bccc4 (Ninja: Do not clean metadata when re-generating inside a running build, 2020-01-27, v3.17.0-rc1~73^2) to remove our workaround when Ninja is new enough. Fixes: #20274
* | | Merge topic 'ninja-cleandead-no-dyndep'Brad King2020-11-111-0/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | c5011399c5 Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5490
| * | Ninja: Avoid cleandead with dyndep bindings for Fortran module dependenciesBrad King2020-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Ninja `cleandead` tool does not account for implicit outputs discovered by `dyndep` bindings and can remove Fortran `.mod` files that are still needed. Disable the `cleandead` step when using `dyndep` bindings. Fixes: #21406
* | | Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-3/+3
| | |