| Index: tools/gn/desc_builder.cc
|
| diff --git a/tools/gn/desc_builder.cc b/tools/gn/desc_builder.cc
|
| index 965ec921f10a12be760ee51aba699debb71b5a23..624e87181e4212543b0a4e2775923487aaae4022 100644
|
| --- a/tools/gn/desc_builder.cc
|
| +++ b/tools/gn/desc_builder.cc
|
| @@ -90,7 +90,7 @@ void RecursiveCollectDeps(const Target* target,
|
|
|
| void RecursiveCollectChildDeps(const Target* target,
|
| std::set<const Target*>* result) {
|
| - for (const auto& pair : target->GetDeps(Target::DEPS_ALL))
|
| + for (const auto& pair : target->GetDeps(Target::DEPS_LINKED))
|
| RecursiveCollectDeps(pair.ptr, result);
|
| }
|
|
|
| @@ -406,6 +406,25 @@ class TargetDescBuilder : public BaseDescBuilder {
|
| if (what(variables::kDeps))
|
| res->SetWithoutPathExpansion(variables::kDeps, RenderDeps());
|
|
|
| + // By default RenderDeps only renders Target::DEPS_PRIVATE, in that case
|
| + // the output should be enriched also with Target::DEPS_PUBLIC.
|
| + if (!tree_ && !all_) {
|
| + if (what(variables::kPublicDeps)) {
|
| + res->SetWithoutPathExpansion(variables::kPublicDeps,
|
| + RenderDepsOf(Target::DEPS_PUBLIC));
|
| + }
|
| + }
|
| +
|
| + if (what(variables::kDataDeps)) {
|
| + res->SetWithoutPathExpansion(variables::kDataDeps,
|
| + RenderDepsOf(Target::DEPS_DATA));
|
| + }
|
| +
|
| + if (what(variables::kLinkedDeps)) {
|
| + res->SetWithoutPathExpansion(variables::kLinkedDeps,
|
| + RenderDepsOf(Target::DEPS_LINKED));
|
| + }
|
| +
|
| // Runtime deps are special, print only when explicitly asked for and not in
|
| // overview mode.
|
| if (what_.find("runtime_deps") != what_.end())
|
| @@ -452,7 +471,7 @@ class TargetDescBuilder : public BaseDescBuilder {
|
| int indent_level) {
|
| // Combine all deps into one sorted list.
|
| std::vector<LabelTargetPair> sorted_deps;
|
| - for (const auto& pair : target->GetDeps(Target::DEPS_ALL))
|
| + for (const auto& pair : target->GetDeps(Target::DEPS_LINKED))
|
| sorted_deps.push_back(pair);
|
| std::sort(sorted_deps.begin(), sorted_deps.end(),
|
| LabelPtrLabelLess<Target>());
|
| @@ -511,9 +530,8 @@ class TargetDescBuilder : public BaseDescBuilder {
|
| } else {
|
| // Show direct dependencies only.
|
| std::vector<const Target*> deps;
|
| - for (const auto& pair : target_->GetDeps(Target::DEPS_ALL))
|
| + for (const auto& pair : target_->GetDeps(Target::DEPS_PRIVATE))
|
| deps.push_back(pair.ptr);
|
| - std::sort(deps.begin(), deps.end());
|
| commands::FilterAndPrintTargets(&deps, res.get());
|
| }
|
| }
|
| @@ -521,6 +539,18 @@ class TargetDescBuilder : public BaseDescBuilder {
|
| return std::move(res);
|
| }
|
|
|
| + ValuePtr RenderDepsOf(Target::DepsIterationType type) {
|
| + auto res = base::MakeUnique<base::ListValue>();
|
| +
|
| + std::vector<const Target*> deps;
|
| + for (const auto& pair : target_->GetDeps(type))
|
| + deps.push_back(pair.ptr);
|
| +
|
| + commands::FilterAndPrintTargets(&deps, res.get());
|
| +
|
| + return std::move(res);
|
| + }
|
| +
|
| ValuePtr RenderRuntimeDeps() {
|
| auto res = base::MakeUnique<base::ListValue>();
|
|
|
|
|