Index: tools/gn/function_toolchain.cc |
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc |
index 43d8cd720592a0bf80b0ccb6595677ca3b26fe6c..c930df2f90fa9a6ad5dec9cfb605c2fdba3713d5 100644 |
--- a/tools/gn/function_toolchain.cc |
+++ b/tools/gn/function_toolchain.cc |
@@ -119,7 +119,13 @@ Value RunToolchain(Scope* scope, |
if (!block_scope.CheckForUnusedVars(err)) |
return Value(); |
- scope->settings()->build_settings()->ItemDefined(toolchain.PassAs<Item>()); |
+ // Save this target for the file. |
+ Scope::ItemVector* collector = scope->GetItemCollector(); |
+ if (!collector) { |
+ *err = Err(function, "Can't define a toolchain in this context."); |
+ return Value(); |
+ } |
+ collector->push_back(new scoped_ptr<Item>(toolchain.PassAs<Item>())); |
return Value(); |
} |