summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Genex: add_custom_command: DEPFILE supports genexMarc Chevrier2021-04-121-1/+1
| | | | | | This facility is very useful for 'Ninja Multi-Config' and required as well for future support of DEPFILE in 'Xcode' and 'Visual Studio' generators (#20286).
* Merge topic 'nmc-cc-no-output'Brad King2021-03-301-0/+5
|\ | | | | | | | | | | | | | | | | 6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output e21a80e97d Tests: Teach RunCMake to ignore incidental 'Recompacting log' ninja output Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !5950
| * Ninja Multi-Config: Fix crash on custom command config with no outputBrad King2021-03-291-0/+5
| | | | | | | | | | | | | | | | With generator expressions in a custom command's `OUTPUT` and `BYPRODUCTS`, it is possible to have no outputs at all for a particular configuration. Generate no rule in this case. Fixes: #21989
* | Merge topic 'ninja-multi-long-custom-command'Brad King2021-03-261-0/+6
|\ \ | |/ | | | | | | | | | | 3b864b2583 Ninja Multi-Config: Include configs in long CC scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5941
| * Ninja Multi-Config: Include configs in long CC scriptsKyle Edwards2021-03-251-0/+6
| | | | | | | | Fixes: #21973
* | Merge topic 'ninja-utf8'Brad King2021-03-101-1/+4
|\ \ | | | | | | | | | | | | | | | | | | 9af6e2e7b2 Ninja: Use new wincodepage tool to determine encoding Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5860
| * | Ninja: Use new wincodepage tool to determine encodingKyle Edwards2021-03-091-1/+4
| |/ | | | | | | | | | | | | | | 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
* | cmLocalGenerator: Clarify GetIncludeFlags signatureBrad King2021-02-251-3/+3
|/ | | | | | | | | | | | | 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.
* Ninja: Use CMP0116 status recorded at time of custom command's creationKyle Edwards2021-02-231-2/+2
|
* clang-tidy: fix `readability-redundant-string-init` warningsBen Boeckel2021-01-271-1/+0
|
* Ninja Multi-Config: Run POST_BUILD when BYPRODUCTS don't overlapKyle Edwards2021-01-071-7/+6
| | | | Fixes: #21252
* Ninja: Omit custom commands with an empty COMMANDShannon Booth2020-12-231-1/+5
| | | | Fixes: #21063
* Ninja Multi-Config: Add support for cross-config custom commandsKyle Edwards2020-12-151-42/+152
| | | | Co-Author: Brad King <brad.king@kitware.com>
* cmLocalGenerator: Refactor custom command generator constructionBrad King2020-12-151-78/+89
| | | | | | | Add support for constructing and using multiple generators for one custom command. cmGeneratorTarget contains a code path that needs this behavior when used with Ninja but not other generators, so use virtual dispatch through cmLocalGenerator.
* cmLocalNinjaGenerator: Remove leftover local debugging commentBrad King2020-10-271-5/+0
|
* Ninja: Transform DEPFILEs with policy CMP0116Kyle Edwards2020-10-131-2/+43
| | | | Fixes: #21267
* Refactor: Use cmToCStr()Vitaly Stakhovsky2020-09-031-2/+1
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* Ninja: Write msvc_deps_prefix as UTF-8 when console codepage is UTF-8Ben McMorran2020-08-071-2/+20
|
* Merge topic 'cleanup-target-types'Brad King2020-07-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ef796cc743 cmGeneratorTarget: Skip computing link implementation for custom targets 45158b2afe cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries d6b1f5704e cmGeneratorTarget: Add missing nullptr checks 7695b67500 cmComputeTargetDepends: Add missing nullptr check 95b5df8646 cmGeneratorTarget: Skip computing languages for custom targets 2f0790df50 Factor out generator checks for filtering on non-compiling targets 422d9a0ab2 Factor out generator checks for filtering out interface libraries bce82df0aa cmGeneratorTarget: Remove unnecessary target type check in dependency tracing ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !5038
| * Factor out generator checks for filtering out interface librariesBrad King2020-07-231-1/+1
| | | | | | | | | | | | Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell generators whether a target should participate in the generated build system.
* | Ninja: Remove parameter default for cmNinjaTargetDependsKyle Edwards2020-07-241-8/+11
|/
* cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-1/+1
|
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* Merge topic 'ninja-multi-install'Brad King2020-05-251-0/+37
|\ | | | | | | | | | | | | dddb4f02f7 Ninja Multi-Config: Make "install" targets depend on default configs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4778
| * Ninja Multi-Config: Make "install" targets depend on default configsKyle Edwards2020-05-221-0/+37
| | | | | | | | | | | | And add an "install:all" target. Fixes: #20713
* | cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-6/+5
| |
* | Merge topic 'cleanup-endls-1'Brad King2020-03-271-16/+11
|\ \ | | | | | | | | | | | | | | | | | | 3fdd8db3aa Refactor: Avoid `std::endl` where it's not necessary (part 1) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4513
| * | Refactor: Avoid `std::endl` where it's not necessary (part 1)Alex Turbov2020-03-261-16/+11
| |/ | | | | | | | | | | | | The `std::endl` manupulator, except inserting `\n` character, also performs `os.flush()`, which may leads to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning.
* | Merge topic 'cmprop-getglobalprop'Brad King2020-03-271-3/+3
|\ \ | | | | | | | | | | | | | | | | | | c84cf42897 cmState::GetGlobalProperty: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4521
| * | cmState::GetGlobalProperty: return cmPropVitaly Stakhovsky2020-03-251-3/+3
| |/
* | Simplify absolute path conversions using CollapseFullPath full signatureBrad King2020-03-241-2/+3
|/
* Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninjaKyle Edwards2020-01-221-5/+5
|
* Ninja: Add multi-config variantKyle Edwards2019-12-131-18/+73
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* Refactor: Prepare Ninja generator for multi-configKyle Edwards2019-12-131-21/+31
|
* cmLocalGenerator: modernize memory managementMarc Chevrier2019-11-111-2/+2
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Ninja: Simplify top-level "all" target generationBrad King2019-09-301-6/+0
| | | | | Remove its dedicated implementation and update the per-directory "all" target generation to work for the top-level directory too.
* Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-1/+3
|\ | | | | | | | | | | | | | | Resolve conflicts with changes since the 3.15 series: * Convert `cmSystemTools::IsOn` => `cmIsOn`. * Move one "EXCLUDE_FROM_ALL" target property logic fix to its new location in `cmMakefile::AddNewUtilityTarget`.
| * Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-1/+3
| |\
| | * Restore "all" target in subdirectories marked EXCLUDE_FROM_ALLBrad King2019-09-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "all" target in each directory is supposed to have targets from that directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in its parent. This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the participation of a target in "all" independent of context. Revert much of the logic change from that commit to restore the old behavior. Then re-implement the behavior intended by the commit to keep its test working. Extend the test to cover the old behavior too. Fixes: #19753
* | | cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utilityDaniel Eiband2019-09-231-6/+4
| | | | | | | | | | | | | | | | | | | | | cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is needed or an instance of cmCompiledGeneratorExpression cannot be cached. Fixes: #19686
* | | clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
| | |
* | | clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-5/+3
| | | | | | | | | | | | | | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* | | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* | | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* | | clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-1/+2
| | |
* | | Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-2/+3
| | |
* | | IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
|/ / | | | | | | | | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* | Ninja: Use cmNinjaBuild instead of WritePhonyBuildSebastian Holtermann2019-05-301-14/+18
| |