| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/runtime_deps.h" | 5 #include "tools/gn/runtime_deps.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 AddIfNew(GetMainOutput(target), target, deps, found_files); | 89 AddIfNew(GetMainOutput(target), target, deps, found_files); |
| 90 | 90 |
| 91 // Add all data files. | 91 // Add all data files. |
| 92 for (const auto& file : target->data()) | 92 for (const auto& file : target->data()) |
| 93 AddIfNew(file, target, deps, found_files); | 93 AddIfNew(file, target, deps, found_files); |
| 94 | 94 |
| 95 // Actions/copy have all outputs considered when the're a data dep. | 95 // Actions/copy have all outputs considered when the're a data dep. |
| 96 if (is_target_data_dep && | 96 if (is_target_data_dep && |
| 97 (target->output_type() == Target::ACTION || | 97 (target->output_type() == Target::ACTION || |
| 98 target->output_type() == Target::ACTION_FOREACH || | 98 target->output_type() == Target::ACTION_FOREACH || |
| 99 target->output_type() == Target::COPY_FILES)) { | 99 target->output_type() == Target::COPY_FILES || |
| 100 target->output_type() == Target::COPY_BUNDLE_DATA)) { |
| 100 std::vector<SourceFile> outputs; | 101 std::vector<SourceFile> outputs; |
| 101 target->action_values().GetOutputsAsSourceFiles(target, &outputs); | 102 target->action_values().GetOutputsAsSourceFiles(target, &outputs); |
| 102 for (const auto& output_file : outputs) | 103 for (const auto& output_file : outputs) |
| 103 AddIfNew(output_file.value(), target, deps, found_files); | 104 AddIfNew(output_file.value(), target, deps, found_files); |
| 104 } | 105 } |
| 105 | 106 |
| 106 // Non-data dependencies (both public and private). | 107 // Non-data dependencies (both public and private). |
| 107 for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) { | 108 for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) { |
| 108 if (dep_pair.ptr->output_type() == Target::EXECUTABLE) | 109 if (dep_pair.ptr->output_type() == Target::EXECUTABLE) |
| 109 continue; // Skip executables that aren't data deps. | 110 continue; // Skip executables that aren't data deps. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 return false; | 266 return false; |
| 266 } | 267 } |
| 267 | 268 |
| 268 // Currently this writes all runtime deps files sequentially. We generally | 269 // Currently this writes all runtime deps files sequentially. We generally |
| 269 // expect few of these. We can run this on the worker pool if it looks | 270 // expect few of these. We can run this on the worker pool if it looks |
| 270 // like it's talking a long time. | 271 // like it's talking a long time. |
| 271 WriteRuntimeDepsFile(target); | 272 WriteRuntimeDepsFile(target); |
| 272 } | 273 } |
| 273 return true; | 274 return true; |
| 274 } | 275 } |
| OLD | NEW |