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

Unified Diff: tools/gn/ninja_binary_target_writer.cc

Issue 1095673002: GN: depend on data deps of source sets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | tools/gn/ninja_binary_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_binary_target_writer.cc
diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc
index a05bdd5db355aa38c3a99ad282956300dedabc73..88a6eb2d546ac6e025a52df9f1d322091a27b864 100644
--- a/tools/gn/ninja_binary_target_writer.cc
+++ b/tools/gn/ninja_binary_target_writer.cc
@@ -428,6 +428,13 @@ void NinjaBinaryTargetWriter::ClassifyDependency(
}
}
}
+
+ // Add the source set itself as a non-linkable dependency on the current
+ // target. This will make sure that anything the source set's stamp file
+ // depends on (like data deps) are also built before the current target
+ // can be complete. Otherwise, these will be skipped since this target
+ // will depend only on the source set's object files.
+ non_linkable_deps->push_back(dep);
} else if (can_link_libs && dep->IsLinkable()) {
linkable_deps->push_back(dep);
} else {
@@ -437,8 +444,7 @@ void NinjaBinaryTargetWriter::ClassifyDependency(
void NinjaBinaryTargetWriter::WriteOrderOnlyDependencies(
const UniqueVector<const Target*>& non_linkable_deps) {
- const std::vector<SourceFile>& data = target_->data();
- if (!non_linkable_deps.empty() || !data.empty()) {
+ if (!non_linkable_deps.empty()) {
out_ << " ||";
// Non-linkable targets.
« no previous file with comments | « no previous file | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698