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

Unified Diff: tools/gn/import_manager.cc

Issue 2940873002: Implement tracking of BUILD.gn files used to define target, toolchain or (Closed)
Patch Set: Fix compilation after rebase. Created 3 years, 6 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/header_checker_unittest.cc ('k') | tools/gn/inherited_libraries_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/import_manager.cc
diff --git a/tools/gn/import_manager.cc b/tools/gn/import_manager.cc
index c9a44d4eaf4d69f52ed2c367fab92b0d4974e0dc..67c992dd422f46cf623e315576ec9340a5f4e78d 100644
--- a/tools/gn/import_manager.cc
+++ b/tools/gn/import_manager.cc
@@ -27,6 +27,10 @@ std::unique_ptr<Scope> UncachedImport(const Settings* settings,
std::unique_ptr<Scope> scope(new Scope(settings->base_config()));
scope->set_source_dir(file.GetDir());
+ const Location& location = node->GetRange().begin();
+ if (!location.is_null())
+ scope->AddInputFile(location.file());
+
// 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.
« no previous file with comments | « tools/gn/header_checker_unittest.cc ('k') | tools/gn/inherited_libraries_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698