| Index: tools/gn/args.cc
|
| diff --git a/tools/gn/args.cc b/tools/gn/args.cc
|
| index 4f746f0c72615c444857905bc396b533b637c42d..2eead427b88349186e2fea5274c2d82d36186104 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);
|
| }
|
|
|