| Index: tools/gn/function_set_default_toolchain.cc
|
| diff --git a/tools/gn/function_set_default_toolchain.cc b/tools/gn/function_set_default_toolchain.cc
|
| index c2b20a5710b01babf87315fd36ea0ad58b372911..78f313fc68474b5e4ea486621b2955db27b5ad18 100644
|
| --- a/tools/gn/function_set_default_toolchain.cc
|
| +++ b/tools/gn/function_set_default_toolchain.cc
|
| @@ -4,10 +4,10 @@
|
|
|
| #include "tools/gn/build_settings.h"
|
| #include "tools/gn/functions.h"
|
| +#include "tools/gn/loader.h"
|
| #include "tools/gn/parse_tree.h"
|
| #include "tools/gn/scope.h"
|
| #include "tools/gn/settings.h"
|
| -#include "tools/gn/toolchain_manager.h"
|
|
|
| namespace functions {
|
|
|
| @@ -52,8 +52,11 @@ Value RunSetDefaultToolchain(Scope* scope,
|
| return Value();
|
| }
|
|
|
| - // Ignore non-default-build-config invocations.
|
| - if (!scope->IsProcessingDefaultBuildConfig())
|
| + // When the loader is expecting the default toolchain to be set, it will set
|
| + // this key on the scope to point to the destination.
|
| + Label* default_toolchain_dest = static_cast<Label*>(
|
| + scope->GetProperty(Loader::kDefaultToolchainKey, NULL));
|
| + if (!default_toolchain_dest)
|
| return Value();
|
|
|
| const SourceDir& current_dir = scope->GetSourceDir();
|
| @@ -66,9 +69,7 @@ Value RunSetDefaultToolchain(Scope* scope,
|
| if (toolchain_label.is_null())
|
| return Value();
|
|
|
| - ToolchainManager& mgr =
|
| - scope->settings()->build_settings()->toolchain_manager();
|
| - mgr.SetDefaultToolchainUnlocked(toolchain_label, function->GetRange(), err);
|
| + *default_toolchain_dest = toolchain_label;
|
| return Value();
|
| }
|
|
|
|
|