| 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 "tools/gn/err.h" | 5 #include "tools/gn/err.h" |
| 6 #include "tools/gn/functions.h" | 6 #include "tools/gn/functions.h" |
| 7 #include "tools/gn/parse_tree.h" | 7 #include "tools/gn/parse_tree.h" |
| 8 #include "tools/gn/scheduler.h" | 8 #include "tools/gn/scheduler.h" |
| 9 #include "tools/gn/scope.h" | 9 #include "tools/gn/scope.h" |
| 10 #include "tools/gn/settings.h" | 10 #include "tools/gn/settings.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // have toolchain names. | 98 // have toolchain names. |
| 99 const SourceDir& input_dir = scope->GetSourceDir(); | 99 const SourceDir& input_dir = scope->GetSourceDir(); |
| 100 Label label(input_dir, args[0].string_value()); | 100 Label label(input_dir, args[0].string_value()); |
| 101 if (g_scheduler->verbose_logging()) | 101 if (g_scheduler->verbose_logging()) |
| 102 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false)); | 102 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false)); |
| 103 | 103 |
| 104 // This object will actually be copied into the one owned by the toolchain | 104 // This object will actually be copied into the one owned by the toolchain |
| 105 // manager, but that has to be done in the lock. | 105 // manager, but that has to be done in the lock. |
| 106 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); | 106 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); |
| 107 toolchain->set_defined_from(function); | 107 toolchain->set_defined_from(function); |
| 108 toolchain->visibility().SetPublic(); |
| 108 | 109 |
| 109 Scope block_scope(scope); | 110 Scope block_scope(scope); |
| 110 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); | 111 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); |
| 111 block->ExecuteBlockInScope(&block_scope, err); | 112 block->ExecuteBlockInScope(&block_scope, err); |
| 112 block_scope.SetProperty(&kToolchainPropertyKey, NULL); | 113 block_scope.SetProperty(&kToolchainPropertyKey, NULL); |
| 113 if (err->has_error()) | 114 if (err->has_error()) |
| 114 return Value(); | 115 return Value(); |
| 115 | 116 |
| 116 if (!block_scope.CheckForUnusedVars(err)) | 117 if (!block_scope.CheckForUnusedVars(err)) |
| 117 return Value(); | 118 return Value(); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 return Value(); | 295 return Value(); |
| 295 | 296 |
| 296 Scope::KeyValueMap values; | 297 Scope::KeyValueMap values; |
| 297 block_scope.GetCurrentScopeValues(&values); | 298 block_scope.GetCurrentScopeValues(&values); |
| 298 toolchain->args() = values; | 299 toolchain->args() = values; |
| 299 | 300 |
| 300 return Value(); | 301 return Value(); |
| 301 } | 302 } |
| 302 | 303 |
| 303 } // namespace functions | 304 } // namespace functions |
| OLD | NEW |