Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: tools/gn/function_set_default_toolchain.cc

Issue 56433003: GN threading refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/copy_target_generator.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « tools/gn/copy_target_generator.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698