| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <limits> | 6 #include <limits> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
| 10 #include "tools/gn/functions.h" | 10 #include "tools/gn/functions.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Note that we don't want to use MakeLabelForScope since that will include | 446 // Note that we don't want to use MakeLabelForScope since that will include |
| 447 // the toolchain name in the label, and toolchain labels don't themselves | 447 // the toolchain name in the label, and toolchain labels don't themselves |
| 448 // have toolchain names. | 448 // have toolchain names. |
| 449 const SourceDir& input_dir = scope->GetSourceDir(); | 449 const SourceDir& input_dir = scope->GetSourceDir(); |
| 450 Label label(input_dir, args[0].string_value()); | 450 Label label(input_dir, args[0].string_value()); |
| 451 if (g_scheduler->verbose_logging()) | 451 if (g_scheduler->verbose_logging()) |
| 452 g_scheduler->Log("Defining toolchain", label.GetUserVisibleName(false)); | 452 g_scheduler->Log("Defining toolchain", label.GetUserVisibleName(false)); |
| 453 | 453 |
| 454 // This object will actually be copied into the one owned by the toolchain | 454 // This object will actually be copied into the one owned by the toolchain |
| 455 // manager, but that has to be done in the lock. | 455 // manager, but that has to be done in the lock. |
| 456 std::unique_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); | 456 std::unique_ptr<Toolchain> toolchain( |
| 457 new Toolchain(scope->settings(), label, scope->input_files())); |
| 457 toolchain->set_defined_from(function); | 458 toolchain->set_defined_from(function); |
| 458 toolchain->visibility().SetPublic(); | 459 toolchain->visibility().SetPublic(); |
| 459 | 460 |
| 460 Scope block_scope(scope); | 461 Scope block_scope(scope); |
| 461 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); | 462 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); |
| 462 block->Execute(&block_scope, err); | 463 block->Execute(&block_scope, err); |
| 463 block_scope.SetProperty(&kToolchainPropertyKey, nullptr); | 464 block_scope.SetProperty(&kToolchainPropertyKey, nullptr); |
| 464 if (err->has_error()) | 465 if (err->has_error()) |
| 465 return Value(); | 466 return Value(); |
| 466 | 467 |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 | 1084 |
| 1084 // Make sure there weren't any vars set in this tool that were unused. | 1085 // Make sure there weren't any vars set in this tool that were unused. |
| 1085 if (!block_scope.CheckForUnusedVars(err)) | 1086 if (!block_scope.CheckForUnusedVars(err)) |
| 1086 return Value(); | 1087 return Value(); |
| 1087 | 1088 |
| 1088 toolchain->SetTool(tool_type, std::move(tool)); | 1089 toolchain->SetTool(tool_type, std::move(tool)); |
| 1089 return Value(); | 1090 return Value(); |
| 1090 } | 1091 } |
| 1091 | 1092 |
| 1092 } // namespace functions | 1093 } // namespace functions |
| OLD | NEW |