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

Unified Diff: tools/gn/setup.cc

Issue 2514333005: Add support for customizing GN's args text. (Closed)
Patch Set: update docs Created 3 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 | « tools/gn/docs/reference.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/setup.cc
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index 5c4e9842fa4ecd22cbba208d834600efc38696b1..2c2ba38526a3bf831b0ce37ef7e20b84f8aed5ec 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -58,8 +58,12 @@ extern const char kDotfile_Help[] =
Variables
+ arg_file_template [optional]
+ Path to a file containing the text that should be used as the default
+ args.gn content when you run `gn args`.
+
buildconfig [required]
- Label of the build config file. This file will be used to set up the
+ Path to the build config file. This file will be used to set up the
build file execution environment for each toolchain.
check_targets [optional]
@@ -790,5 +794,16 @@ bool Setup::FillOtherConfig(const base::CommandLine& cmdline) {
default_args_ = default_args_value->scope_value();
}
+ const Value* arg_file_template_value =
+ dotfile_scope_.GetValue("arg_file_template", true);
+ if (arg_file_template_value) {
+ if (!arg_file_template_value->VerifyTypeIs(Value::STRING, &err)) {
+ err.PrintToStdout();
+ return false;
+ }
+ SourceFile path(arg_file_template_value->string_value());
+ build_settings_.set_arg_file_template_path(path);
+ }
+
return true;
}
« no previous file with comments | « tools/gn/docs/reference.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698