Index: tools/gn/import_manager.cc |
diff --git a/tools/gn/import_manager.cc b/tools/gn/import_manager.cc |
index 2e8293ed7cff7071459aa733be4af6b1ba31d1e3..4bb4b63eee731b3c2cccc834499c7c2e53a58c59 100644 |
--- a/tools/gn/import_manager.cc |
+++ b/tools/gn/import_manager.cc |
@@ -25,8 +25,13 @@ 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()); |
+ |
+ // Don't allow ScopePerFileProvider to provide target-related variables. |
+ // These will be relative to the imported file, which is probably not what |
+ // people mean when they use these. |
+ ScopePerFileProvider per_file_provider(scope.get(), false); |
+ |
scope->SetProcessingImport(); |
block->ExecuteBlockInScope(scope.get(), err); |
if (err->has_error()) |