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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // have toolchain names. | 100 // have toolchain names. |
101 const SourceDir& input_dir = scope->GetSourceDir(); | 101 const SourceDir& input_dir = scope->GetSourceDir(); |
102 Label label(input_dir, args[0].string_value()); | 102 Label label(input_dir, args[0].string_value()); |
103 if (g_scheduler->verbose_logging()) | 103 if (g_scheduler->verbose_logging()) |
104 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false)); | 104 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false)); |
105 | 105 |
106 // This object will actually be copied into the one owned by the toolchain | 106 // This object will actually be copied into the one owned by the toolchain |
107 // manager, but that has to be done in the lock. | 107 // manager, but that has to be done in the lock. |
108 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); | 108 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); |
109 toolchain->set_defined_from(function); | 109 toolchain->set_defined_from(function); |
| 110 toolchain->visibility().SetPublic(); |
110 | 111 |
111 Scope block_scope(scope); | 112 Scope block_scope(scope); |
112 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); | 113 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); |
113 block->ExecuteBlockInScope(&block_scope, err); | 114 block->ExecuteBlockInScope(&block_scope, err); |
114 block_scope.SetProperty(&kToolchainPropertyKey, NULL); | 115 block_scope.SetProperty(&kToolchainPropertyKey, NULL); |
115 if (err->has_error()) | 116 if (err->has_error()) |
116 return Value(); | 117 return Value(); |
117 | 118 |
118 if (!block_scope.CheckForUnusedVars(err)) | 119 if (!block_scope.CheckForUnusedVars(err)) |
119 return Value(); | 120 return Value(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 return Value(); | 301 return Value(); |
301 | 302 |
302 Scope::KeyValueMap values; | 303 Scope::KeyValueMap values; |
303 block_scope.GetCurrentScopeValues(&values); | 304 block_scope.GetCurrentScopeValues(&values); |
304 toolchain->args() = values; | 305 toolchain->args() = values; |
305 | 306 |
306 return Value(); | 307 return Value(); |
307 } | 308 } |
308 | 309 |
309 } // namespace functions | 310 } // namespace functions |
OLD | NEW |