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

Unified Diff: tools/gn/args.cc

Issue 161783002: Remove default value checking in GN, adds getenv function, reorders parameters to rebase_path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/command_args.cc » ('j') | no next file with comments »
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 d71dcb6a8d7a79722a21e247140cfb7efe39a99d..2c4891ca82bb742b3cad77d52afdf2515a43204c 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -120,11 +120,7 @@ bool Args::DeclareArgs(const Scope::KeyValueMap& args,
//
// The tricky part is that a buildfile can be interpreted multiple times
// when used from different toolchains, so we can't just check that we've
- // seen it before. Instead, we check that the location matches. We
- // additionally check that the value matches to prevent people from
- // declaring defaults based on other parameters that may change. The
- // rationale is that you should have exactly one default value for each
- // argument that we can display in the help.
+ // seen it before. Instead, we check that the location matches.
Scope::KeyValueMap::iterator previously_declared =
declared_arguments_.find(i->first);
if (previously_declared != declared_arguments_.end()) {
@@ -142,14 +138,6 @@ bool Args::DeclareArgs(const Scope::KeyValueMap& args,
"See also \"gn help buildargs\" for more on how "
"build arguments work."));
return false;
- } else if (previously_declared->second != i->second) {
- // Default value mismatch.
- *err = Err(i->second.origin(),
- "Non-constant default value for build argument.",
- "Each build argument should have one default value so we report "
- "it nicely in the\n\"gn args\" command. Please make this value "
- "constant.");
- return false;
}
} else {
declared_arguments_.insert(*i);
« no previous file with comments | « no previous file | tools/gn/command_args.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698