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

Unified Diff: tools/gn/target_generator.cc

Issue 269723006: Add get_target_outputs function to GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 7 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/scope.cc ('k') | tools/gn/template.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_generator.cc
diff --git a/tools/gn/target_generator.cc b/tools/gn/target_generator.cc
index 28202987703c2f2167b5a55bf7a55ccf8508a69f..cf6bc1f7d4ae10272211065d2387c928226e5114 100644
--- a/tools/gn/target_generator.cc
+++ b/tools/gn/target_generator.cc
@@ -117,8 +117,16 @@ void TargetGenerator::GenerateTarget(Scope* scope,
"I am very confused.");
}
- if (!err->has_error())
- scope->settings()->build_settings()->ItemDefined(target.PassAs<Item>());
+ if (err->has_error())
+ return;
+
+ // Save this target for the file.
+ Scope::ItemVector* collector = scope->GetItemCollector();
+ if (!collector) {
+ *err = Err(function_call, "Can't define a target in this context.");
+ return;
+ }
+ collector->push_back(new scoped_ptr<Item>(target.PassAs<Item>()));
}
const BuildSettings* TargetGenerator::GetBuildSettings() const {
« no previous file with comments | « tools/gn/scope.cc ('k') | tools/gn/template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698