Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/gn/target.h" | 5 #include "tools/gn/target.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Only check private deps if requested. | 120 // Only check private deps if requested. |
| 121 if (check_private_deps) { | 121 if (check_private_deps) { |
| 122 for (const auto& pair : target->private_deps()) { | 122 for (const auto& pair : target->private_deps()) { |
| 123 if (EnsureFileIsGeneratedByDependency(pair.ptr, file, false, | 123 if (EnsureFileIsGeneratedByDependency(pair.ptr, file, false, |
| 124 consider_object_files, | 124 consider_object_files, |
| 125 seen_targets)) | 125 seen_targets)) |
| 126 return true; // Found a path. | 126 return true; // Found a path. |
| 127 } | 127 } |
| 128 for (const auto& pair : target->bundle_data().deps()) { | |
| 129 if (EnsureFileIsGeneratedByDependency(pair.ptr, file, false, | |
| 130 consider_object_files, | |
| 131 seen_targets)) | |
| 132 return true; // Found a path. | |
| 133 } | |
| 128 } | 134 } |
| 129 return false; | 135 return false; |
| 130 } | 136 } |
| 131 | 137 |
| 132 // check_this indicates if the given target should be matched against the | 138 // check_this indicates if the given target should be matched against the |
| 133 // patterns. It should be set to false for the first call since assert_no_deps | 139 // patterns. It should be set to false for the first call since assert_no_deps |
| 134 // shouldn't match the target itself. | 140 // shouldn't match the target itself. |
| 135 // | 141 // |
| 136 // visited should point to an empty set, this will be used to prevent | 142 // visited should point to an empty set, this will be used to prevent |
| 137 // multiple visits. | 143 // multiple visits. |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 | 507 |
| 502 for (const LabelTargetPair& pair : current->GetDeps(DEPS_ALL)) { | 508 for (const LabelTargetPair& pair : current->GetDeps(DEPS_ALL)) { |
| 503 DCHECK(pair.ptr); | 509 DCHECK(pair.ptr); |
| 504 DCHECK(pair.ptr->toolchain_); | 510 DCHECK(pair.ptr->toolchain_); |
| 505 if (visited.find(pair.ptr) != visited.end()) | 511 if (visited.find(pair.ptr) != visited.end()) |
| 506 continue; | 512 continue; |
| 507 | 513 |
| 508 if (pair.ptr->output_type() == CREATE_BUNDLE) | 514 if (pair.ptr->output_type() == CREATE_BUNDLE) |
| 509 continue; | 515 continue; |
| 510 | 516 |
| 511 deps.push_back(pair.ptr); | 517 deps.push_back(pair.ptr); |
|
brettw
2016/03/16 17:27:44
I was studying Target::PullRecursiveBundleData mor
| |
| 512 } | 518 } |
| 513 } | 519 } |
| 514 | 520 |
| 515 bundle_data_.GetSourceFiles(&sources_); | 521 bundle_data_.GetSourceFiles(&sources_); |
| 516 } | 522 } |
| 517 | 523 |
| 518 void Target::FillOutputFiles() { | 524 void Target::FillOutputFiles() { |
| 519 const Tool* tool = toolchain_->GetToolForTargetFinalOutput(this); | 525 const Tool* tool = toolchain_->GetToolForTargetFinalOutput(this); |
| 520 bool check_tool_outputs = false; | 526 bool check_tool_outputs = false; |
| 521 switch (output_type_) { | 527 switch (output_type_) { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 764 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, false, | 770 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, false, |
| 765 &seen_targets)) { | 771 &seen_targets)) { |
| 766 // Check object files (much slower and very rare) only if the "normal" | 772 // Check object files (much slower and very rare) only if the "normal" |
| 767 // output check failed. | 773 // output check failed. |
| 768 seen_targets.clear(); | 774 seen_targets.clear(); |
| 769 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, true, | 775 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, true, |
| 770 &seen_targets)) | 776 &seen_targets)) |
| 771 g_scheduler->AddUnknownGeneratedInput(this, source); | 777 g_scheduler->AddUnknownGeneratedInput(this, source); |
| 772 } | 778 } |
| 773 } | 779 } |
| OLD | NEW |