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

Unified Diff: tools/gn/loader.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/gn.gyp ('k') | tools/gn/scope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/loader.cc
diff --git a/tools/gn/loader.cc b/tools/gn/loader.cc
index 2893e2394cbb4a124958895d89338a796c8fb70d..885670ab80572bd1d1d5d82baec4265cc1c3c631 100644
--- a/tools/gn/loader.cc
+++ b/tools/gn/loader.cc
@@ -247,6 +247,10 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings,
ScopePerFileProvider per_file_provider(&our_scope, true);
our_scope.set_source_dir(file_name.GetDir());
+ // Targets, etc. generated as part of running this file will end up here.
+ Scope::ItemVector collected_items;
+ our_scope.set_item_collector(&collected_items);
+
ScopedTrace trace(TraceItem::TRACE_FILE_EXECUTE, file_name.value());
trace.SetToolchain(settings->toolchain_label());
@@ -255,6 +259,10 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings,
if (err.has_error())
g_scheduler->FailWithError(err);
+ // Pass all of the items that were defined off to the builder.
+ for (size_t i = 0; i < collected_items.size(); i++)
+ settings->build_settings()->ItemDefined(collected_items[i]->Pass());
+
trace.Done();
main_loop_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this));
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/scope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698