summaryrefslogtreecommitdiffstats
path: root/tools/gn/args.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 22:23:17 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 22:23:17 +0000
commitdbd915b46e952364ad911640fef194b6f36076f9 (patch)
tree9f297bba036484d9952d43464ee48bd6ebd80303 /tools/gn/args.cc
parentbc6cc6f9b04138e9fd09f00a9d00633734189af9 (diff)
downloadchromium_src-dbd915b46e952364ad911640fef194b6f36076f9.zip
chromium_src-dbd915b46e952364ad911640fef194b6f36076f9.tar.gz
chromium_src-dbd915b46e952364ad911640fef194b6f36076f9.tar.bz2
Fix the output of "gn args" for the OS and CPU architecture.
The internal declarations of these weren't getting set correctly. This only affects the output of "gn args". BUG= R=thakis@chromium.org Review URL: https://codereview.chromium.org/40533003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/args.cc')
-rw-r--r--tools/gn/args.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/gn/args.cc b/tools/gn/args.cc
index 4f746f0..2eead42 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -55,10 +55,6 @@ const char kBuildArgs_Help[] =
" arguments to apply to multiple buildfiles.\n";
Args::Args() {
- // These system values are always overridden and won't appear in a
- // declare_args call, so mark them as used to prevent a warning later.
- declared_arguments_[variables::kOs] = Value();
- declared_arguments_[variables::kCpuArch] = Value();
}
Args::Args(const Args& other)
@@ -178,8 +174,6 @@ void Args::SetSystemVars(Scope* dest) const {
Value os_val(NULL, std::string(os));
dest->SetValue(variables::kBuildOs, os_val, NULL);
dest->SetValue(variables::kOs, os_val, NULL);
- declared_arguments_[variables::kBuildOs] = os_val;
- declared_arguments_[variables::kOs] = os_val;
// Host architecture.
static const char kIa32[] = "ia32";
@@ -221,11 +215,17 @@ void Args::SetSystemVars(Scope* dest) const {
Value arch_val(NULL, std::string(arch));
dest->SetValue(variables::kBuildCpuArch, arch_val, NULL);
dest->SetValue(variables::kCpuArch, arch_val, NULL);
- declared_arguments_[variables::kBuildOs] = arch_val;
- declared_arguments_[variables::kOs] = arch_val;
+ // Save the OS and architecture as build arguments that are implicitly
+ // declared. This is so they can be overridden in a toolchain build args
+ // override, and so that they will appear in the "gn args" output.
+ //
+ // Do not declare the build* variants since these shouldn't be changed.
+ //
// Mark these variables used so the build config file can override them
// without geting a warning about overwriting an unused variable.
+ declared_arguments_[variables::kOs] = os_val;
+ declared_arguments_[variables::kCpuArch] = arch_val;
dest->MarkUsed(variables::kCpuArch);
dest->MarkUsed(variables::kOs);
}