Commit c2f498dd authored by brettw's avatar brettw Committed by Commit bot

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}
parent 4417ab30
......@@ -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();
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment