summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-04-27 14:31:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-27 21:31:10 +0000
commitc2f498dd8cb63c49663b5f80aabf808b4fd1d1c4 (patch)
tree707a14c8e98ee5e239b33c4da2847bcf9d2d4927 /tools
parent4417ab30e74fa234a5cc0623ef7d13bc609802fc (diff)
downloadchromium_src-c2f498dd8cb63c49663b5f80aabf808b4fd1d1c4.zip
chromium_src-c2f498dd8cb63c49663b5f80aabf808b4fd1d1c4.tar.gz
chromium_src-c2f498dd8cb63c49663b5f80aabf808b4fd1d1c4.tar.bz2
Allow paths to be resolved in the GN args file
This uses the real settings object which contains the location of the source root for resolving "//..." paths. The use-case is to allow imports to be processed in the args file, which in turn allows one to assign a set of build arguments by reference. Review URL: https://codereview.chromium.org/1104313002 Cr-Commit-Position: refs/heads/master@{#327131}
Diffstat (limited to 'tools')
-rw-r--r--tools/gn/setup.cc8
-rw-r--r--tools/gn/setup.h7
2 files changed, 7 insertions, 8 deletions
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index c70eab8..d8d525a 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -160,10 +160,10 @@ Setup::Setup()
check_for_bad_items_(true),
check_for_unused_overrides_(true),
check_public_headers_(false),
- empty_settings_(&empty_build_settings_, std::string()),
- dotfile_scope_(&empty_settings_),
+ dotfile_settings_(&build_settings_, std::string()),
+ dotfile_scope_(&dotfile_settings_),
fill_arguments_(true) {
- empty_settings_.set_toolchain_label(Label());
+ dotfile_settings_.set_toolchain_label(Label());
build_settings_.set_item_defined_callback(
base::Bind(&ItemDefinedCallback, scheduler_.main_loop(), builder_));
@@ -340,7 +340,7 @@ bool Setup::FillArgsFromArgsInputFile() {
return false;
}
- Scope arg_scope(&empty_settings_);
+ Scope arg_scope(&dotfile_settings_);
args_root_->Execute(&arg_scope, &err);
if (err.has_error()) {
err.PrintToStdout();
diff --git a/tools/gn/setup.h b/tools/gn/setup.h
index 2e0e367..2e028e3 100644
--- a/tools/gn/setup.h
+++ b/tools/gn/setup.h
@@ -151,10 +151,9 @@ class Setup {
Scheduler scheduler_;
- // These empty settings and toolchain are used to interpret the command line
- // and dot file.
- BuildSettings empty_build_settings_;
- Settings empty_settings_;
+ // These settings and toolchain are used to interpret the command line and
+ // dot file.
+ Settings dotfile_settings_;
Scope dotfile_scope_;
// State for invoking the dotfile.