Commit 5865860f authored by brettw@chromium.org's avatar brettw@chromium.org

GN: Attach the scope provider to imported files.

This enables imports to use the built-in programatic variables like root_build_dir.

R=scottmg@chromium.org, scottmg

Review URL: https://codereview.chromium.org/126033006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243444 0039d316-1c4b-4281-b951-d872f2087c98
parent ec5c652c
......@@ -8,6 +8,7 @@
#include "base/stl_util.h"
#include "tools/gn/parse_tree.h"
#include "tools/gn/scheduler.h"
#include "tools/gn/scope_per_file_provider.h"
namespace {
......@@ -24,6 +25,7 @@ Scope* UncachedImport(const Settings* settings,
CHECK(block);
scoped_ptr<Scope> scope(new Scope(settings->base_config()));
ScopePerFileProvider per_file_provider(scope.get());
scope->set_source_dir(file.GetDir());
scope->SetProcessingImport();
block->ExecuteBlockInScope(scope.get(), err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment