summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* | cmGlobalNinjaGenerator: verify generated objects against filesetsBen Boeckel2022-07-061-3/+137
| |
* | cmGlobalNinjaGenerator: use `cmModuleMapper` implementationBen Boeckel2022-06-161-38/+31
| |
* | cmGlobalNinjaGenerator: add a TODO for header unitsBen Boeckel2022-06-161-1/+2
| |
* | cmGlobalNinjaGenerator: simplify a string building callBen Boeckel2022-06-141-1/+1
| |
* | cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-8/+8
| | | | | | | | | | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* | cmGlobalNinjaGenerator: use an extention based on the modmapfmtBen Boeckel2022-04-271-1/+6
| |
* | cmGlobalNinjaGenerator: escape `:` in module namesBen Boeckel2022-04-271-1/+3
| | | | | | | | | | | | Not all filesystems support `:` in the name, so replace it with `-`. As `-` is not otherwise allowed in module names anyways, there is no risk of conflict.
* | cmOutputConverter: Always set relative path top source and binary togetherBrad King2022-02-281-2/+1
|/ | | | | Refactor to set both at once so we have a single place in the code that knows both have been set.
* Merge topic 'enlarge-build-file-stream-buffer'Brad King2022-01-271-0/+13
|\ | | | | | | | | | | | | 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/+13
| |
* | Merge topic 'encode-literal-inplace'Brad King2022-01-271-6/+10
|\ \ | | | | | | | | | | | | | | | | | | 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-6/+10
| |/
* | cmBuildOptions: Split build arguments into separate object.Carsten Rudolph2022-01-221-1/+1
|/
* Merge topic 'nmc-cross-config-target-deps'Brad King2021-11-051-3/+0
|\ | | | | | | | | | | | | | | | | | | 95f44e00cd Ninja Multi-Config: Fix custom command target dependencies in cross-configs a883363935 Ninja Multi-Config: Fix internal cross-config target dependency ordering 16e24748c5 Ninja Multi-Config: Fix cross-config custom command dependency tracing Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6702
| * Ninja Multi-Config: Fix cross-config custom command dependency tracingBrad King2021-11-041-3/+0
| | | | | | | | | | | | Process `CMAKE_CROSS_CONFIGS` and friends to properly configure the generator for cross-config behavior before custom command dependency tracing.
* | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-1/+1
|/
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-2/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* Merge topic 'platform-vars'Brad King2021-09-211-21/+13
|\ | | | | | | | | | | | | | | | | | | a136b6ec98 MINGW: Define variable only when targeting Windows platforms 39c5dad0cb Ninja: Remove redundant check for GNU-like compiler on Windows 0b7ae84a96 Cygwin: Remove redundant definitions of CYGWIN and UNIX variables Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6538
| * Ninja: Remove redundant check for GNU-like compiler on WindowsBrad King2021-09-171-21/+13
| | | | | | | | | | | | | | | | | | Update the Ninja generator's check to work using whatever language is being enabled instead of hard-coding C and CXX. With that, the undocumented internal `CMAKE_COMPILER_IS_MINGW` variable is only set by compilers already covered by other alternatives in the condition. See commit b3de0dfe93 (Ninja: Use forward slashes for any GCC on Windows, 2015-05-07, v3.3.0-rc1~93^2~3).
* | cmSystemTools::VersionCompare: use std::string for argumentsMarc Chevrier2021-09-171-30/+29
|/
* Merge topic 'ninja-armclang-windows'Brad King2021-09-031-0/+2
|\ | | | | | | | | | | | | b6cf93472f Ninja: fix ARMClang paths for Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6484
| * Ninja: fix ARMClang paths for WindowsMartin Kojtal2021-09-021-0/+2
| | | | | | | | | | | | | | We need to escape paths for ARMClang on Windows, see the referenced issue for more details. Fixes: #21093
* | cmMakefile: Add helper to initialize CMAKE_CONFIGURATION_TYPESBrad King2021-06-301-8/+1
| | | | | | | | | | Factor out duplicate code from the Ninja Multi-Config, Visual Studio, and Xcode generators.
* | Ninja: Use `ccmake` for `edit_cache`NAKAMURA Takumi2021-06-291-7/+0
| | | | | | | | | | If `ninja` is new enough to support the console pool, and `ccmake` is available, use it for `edit_cache`.
* | cmGlobalNinjaGenerator: Rename SupportsConsolePool to SupportsDirectConsoleNAKAMURA Takumi2021-06-291-3/+3
|/ | | | Use a name that is not ninja-specific.
* Ninja: Populate P1689R4 compiled-module-path field for FortranBrad King2021-06-151-0/+21
| | | | | | | | | | When scanning Fortran dependencies, we know the file path at which a provided module file is written. Store it in the `compiled-module-path` field as specified by P1689R4. Our collator in `cmake_ninja_dyndep` no longer needs to assume that the module file path can be derived from the logical module name. In the future, the Fortran dependency scanning may be done by the compiler itself, in which case it will provide the value of `compiled-module-path`.
* cmScanDepFormat: Remove Fortran-specific compiled-module-path logicBrad King2021-06-151-4/+12
| | | | | | | Read and write the `compiled-module-path` field only when explicitly known. Move the assumption that the `compiled-module-path` can be derived from the logical module name from the scandep parser to the `cmake_ninja_dyndep` helper.
* Ninja: Always compile sources using absolute pathsBrad King2021-05-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Ninja: Handle depfiles with absolute paths to generated files in Ninja < 1.7Brad King2021-05-251-7/+15
| | | | | | | | | Extend the change from commit 2725ecff38 (Ninja: Handle depfiles with absolute paths to generated files, 2021-05-19) to work on versions of Ninja that do not support implicit outputs. Specify the absolute paths as normal outputs on such versions. Issue: #13894, #21865
* cmGlobalNinjaGenerator: Add helper to compute absolute paths for build.ninjaBrad King2021-05-251-0/+9
|
* Ninja: Handle depfiles with absolute paths to generated filesBrad King2021-05-191-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Improve allocation pattern in WriteBuildBrad King2021-05-191-5/+4
|
* cmGlobalNinjaGenerator: Factor out custom command output collectionBrad King2021-05-191-3/+15
| | | | | | 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-10/+10
| | | | | Re-order arguments to group those with similar roles. Use move semantics to avoid copying vectors of strings.
* cmGlobalNinjaGenerator: Re-order logic in WriteCustomCommandBuildBrad King2021-05-191-8/+8
| | | | Save explicit dependencies earlier.
* cmGlobalNinjaGenerator: Record implicit outputs as known tooBrad King2021-05-191-0/+3
|
* cmOutputConverter: Adopt relative path conversion helpersBrad King2021-05-171-2/+2
| | | | Move them up from cmLocalGenerator and out of cmStateDirectory.
* Merge topic 'relative-paths'Brad King2021-05-141-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | f6d4fa63f8 cmStateDirectory: Comment relative path top directory selection approach f0ffb1e2d4 cmGlobalGenerator: Simplify relative path conversion in AddRuleHash d346805e41 cmLocalCommonGenerator: Select work directory semantically 15fa320071 cmLocalGenerator: Factor out relative path conversion helpers 1879f1bcbc cmLocalCommonGenerator: Factor out relative path conversion helper 1d1d88d3c8 cmMakefileTargetGenerator: Clarify name of relative path conversion helper ec1ea13066 cmDependsFortran: Simplify relative path conversion helper ba7b939831 cmStateDirectory: Rename ConvertToRelPathIf{Not => }Contained ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6122
| * cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-4/+2
| | | | | | | | | | | | 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.
* | cmGlobalNinjaGenerator: Clarify semantics of Fortran scanning infoBrad King2021-05-131-7/+9
| | | | | | | | Use `optional<>` instead of `unique_ptr<>` to hold optional value.
* | cmScanDepFormat: Drop unused "outputs", "inputs", and "depends" fieldsBrad King2021-05-131-15/+21
|/ | | | | | | 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.
* Merge topic 'ninja-regenerate-no-recompact'Brad King2021-03-171-2/+3
|\ | | | | | | | | | | | | | | 6fd9c68ed0 Ninja: Do not recompact deps log in regeneration during a build Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !5916
| * Ninja: Do not recompact deps log in regeneration during a buildBrad King2021-03-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit fb18215904 (Ninja: clean ninja metadata once generated, 2019-05-13, v3.17.0-rc1~207^2) we recompact the ninja deps log during regeneration. That does not make sense during a build, so skip it if we are regenerating during a build. This problem went unnoticed previously because on non-Windows platforms the deps log is just overwritten again by the outer build. On Windows platforms, recompaction during the build fails, but we did not actually try to do that until commit 11f4259362 (Ninja: Clean metadata after regen during build on Windows with 1.10.2+, 2020-11-30, v3.19.2~29^2~1). Fixes: #21916
* | Ninja: Use new wincodepage tool to determine encodingKyle Edwards2021-03-091-8/+57
| | | | | | | | | | | | | | | | 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
* | clang-tidy: fix `readability-use-anyofallof` warningsBen Boeckel2021-01-271-23/+25
| |
* | Merge topic 'cpp-modules'Brad King2021-01-071-4/+84
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 gcc-format modmap filesBen Boeckel2021-01-051-1/+24
| | |
| * | ninja: add experimental infrastructure to generate modmap files with dyndepBen Boeckel2021-01-051-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>