Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: tools/gn/ninja_target_writer.cc

Issue 2071573003: GN: Use implicit dependency for binary input deps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review changes Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/ninja_target_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_target_writer.cc
diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc
index 486930bd2ffeb224f6985d16860ee42c2431a8ce..7843d757a7161bdebf1fcf9a81387f68c58efc1f 100644
--- a/tools/gn/ninja_target_writer.cc
+++ b/tools/gn/ninja_target_writer.cc
@@ -165,9 +165,13 @@ OutputFile NinjaTargetWriter::WriteInputDepsStampAndGetDep(
target_->output_type() == Target::ACTION_FOREACH)
input_deps_sources.push_back(&target_->action_values().script());
- // Input files.
- for (const auto& input : target_->inputs())
- input_deps_sources.push_back(&input);
+ // Input files are only considered for non-binary targets which use an
+ // implicit dependency instead. The implicit depedency in this case is
+ // handled separately by the binary target writer.
+ if (!target_->IsBinary()) {
+ for (const auto& input : target_->inputs())
+ input_deps_sources.push_back(&input);
+ }
// For an action (where we run a script only once) the sources are the same
// as the inputs. For action_foreach, the sources will be operated on
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/ninja_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698