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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 str, | 46 str, |
47 source->settings()->build_settings()->build_dir(), | 47 source->settings()->build_settings()->build_dir(), |
48 source->settings()->build_settings()->root_path_utf8())); | 48 source->settings()->build_settings()->root_path_utf8())); |
49 AddIfNew(output_file, source, deps, found_file); | 49 AddIfNew(output_file, source, deps, found_file); |
50 } | 50 } |
51 | 51 |
52 // Returns the output file that the runtime deps considers for the given | 52 // Returns the output file that the runtime deps considers for the given |
53 // targets. This is weird only for shared libraries. | 53 // targets. This is weird only for shared libraries. |
54 const OutputFile& GetMainOutput(const Target* target) { | 54 const OutputFile& GetMainOutput(const Target* target) { |
55 if (target->output_type() == Target::SHARED_LIBRARY) | 55 if (target->output_type() == Target::SHARED_LIBRARY) |
56 return target->link_output_file(); | 56 return target->runtime_link_output_file(); |
57 return target->dependency_output_file(); | 57 return target->dependency_output_file(); |
58 } | 58 } |
59 | 59 |
60 // To avoid duplicate traversals of targets, or duplicating output files that | 60 // To avoid duplicate traversals of targets, or duplicating output files that |
61 // might be listed by more than one target, the set of targets and output files | 61 // might be listed by more than one target, the set of targets and output files |
62 // that have been found so far is passed. The "value" of the seen_targets map | 62 // that have been found so far is passed. The "value" of the seen_targets map |
63 // is a boolean indicating if the seen dep was a data dep (true = data_dep). | 63 // is a boolean indicating if the seen dep was a data dep (true = data_dep). |
64 // data deps add more stuff, so we will want to revisit a target if it's a | 64 // data deps add more stuff, so we will want to revisit a target if it's a |
65 // data dependency and we've previously only seen it as a regular dep. | 65 // data dependency and we've previously only seen it as a regular dep. |
66 void RecursiveCollectRuntimeDeps(const Target* target, | 66 void RecursiveCollectRuntimeDeps(const Target* target, |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 return false; | 265 return false; |
266 } | 266 } |
267 | 267 |
268 // Currently this writes all runtime deps files sequentially. We generally | 268 // 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 | 269 // expect few of these. We can run this on the worker pool if it looks |
270 // like it's talking a long time. | 270 // like it's talking a long time. |
271 WriteRuntimeDepsFile(target); | 271 WriteRuntimeDepsFile(target); |
272 } | 272 } |
273 return true; | 273 return true; |
274 } | 274 } |
OLD | NEW |