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

Unified Diff: tools/gn/scope_per_file_provider.cc

Issue 226223006: Template invocation fixes in GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
Index: tools/gn/scope_per_file_provider.cc
diff --git a/tools/gn/scope_per_file_provider.cc b/tools/gn/scope_per_file_provider.cc
index c6a0cd7f635b6d799709379c4139090eecbd44b3..64b9a83edc27b9a861e02ae49ee76a66935867ac 100644
--- a/tools/gn/scope_per_file_provider.cc
+++ b/tools/gn/scope_per_file_provider.cc
@@ -10,8 +10,10 @@
#include "tools/gn/value.h"
#include "tools/gn/variables.h"
-ScopePerFileProvider::ScopePerFileProvider(Scope* scope)
- : ProgrammaticProvider(scope) {
+ScopePerFileProvider::ScopePerFileProvider(Scope* scope,
+ bool allow_target_vars)
+ : ProgrammaticProvider(scope),
+ allow_target_vars_(allow_target_vars) {
}
ScopePerFileProvider::~ScopePerFileProvider() {
@@ -32,10 +34,13 @@ const Value* ScopePerFileProvider::GetProgrammaticValue(
return GetRootGenDir();
if (ident == variables::kRootOutDir)
return GetRootOutDir();
- if (ident == variables::kTargetGenDir)
- return GetTargetGenDir();
- if (ident == variables::kTargetOutDir)
- return GetTargetOutDir();
+
+ if (allow_target_vars_) {
+ if (ident == variables::kTargetGenDir)
+ return GetTargetGenDir();
+ if (ident == variables::kTargetOutDir)
+ return GetTargetOutDir();
+ }
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698