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

Unified Diff: tools/gn/args.cc

Issue 2936923002: Add not_needed function (Closed)
Patch Set: Rename to not_needed 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 | « no previous file | tools/gn/docs/reference.md » ('j') | tools/gn/functions.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/args.cc
diff --git a/tools/gn/args.cc b/tools/gn/args.cc
index 0dcceecd5a5fe396402b1558b071a5f059650465..862e2e900a3aee53cfd2018b756bb51211880b65 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -6,6 +6,7 @@
#include "base/sys_info.h"
#include "build/build_config.h"
+#include "tools/gn/scheduler.h"
#include "tools/gn/string_utils.h"
#include "tools/gn/variables.h"
@@ -210,7 +211,7 @@ bool Args::DeclareArgs(const Scope::KeyValueMap& args,
scope_to_set->SetValue(toolchain_override->first,
toolchain_override->second,
toolchain_override->second.origin());
- scope_to_set->MarkUsed(arg.first);
+ scope_to_set->MarkUsed(arg.first, err);
continue;
}
@@ -220,12 +221,12 @@ bool Args::DeclareArgs(const Scope::KeyValueMap& args,
if (override != overrides_.end()) {
scope_to_set->SetValue(override->first, override->second,
override->second.origin());
- scope_to_set->MarkUsed(override->first);
+ scope_to_set->MarkUsed(override->first, err);
continue;
}
scope_to_set->SetValue(arg.first, arg.second, arg.second.origin());
- scope_to_set->MarkUsed(arg.first);
+ scope_to_set->MarkUsed(arg.first, err);
}
return true;
@@ -369,12 +370,15 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
// Mark these variables used so the build config file can override them
// without geting a warning about overwriting an unused variable.
- dest->MarkUsed(variables::kHostCpu);
- dest->MarkUsed(variables::kCurrentCpu);
- dest->MarkUsed(variables::kTargetCpu);
- dest->MarkUsed(variables::kHostOs);
- dest->MarkUsed(variables::kCurrentOs);
- dest->MarkUsed(variables::kTargetOs);
+ Err err;
+ dest->MarkUsed(variables::kHostCpu, &err);
+ dest->MarkUsed(variables::kCurrentCpu, &err);
+ dest->MarkUsed(variables::kTargetCpu, &err);
+ dest->MarkUsed(variables::kHostOs, &err);
+ dest->MarkUsed(variables::kCurrentOs, &err);
+ dest->MarkUsed(variables::kTargetOs, &err);
+ if (err.has_error())
+ g_scheduler->FailWithError(err);
}
void Args::ApplyOverridesLocked(const Scope::KeyValueMap& values,
« no previous file with comments | « no previous file | tools/gn/docs/reference.md » ('j') | tools/gn/functions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698