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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Note that we don't want to use MakeLabelForScope since that will include | 95 // Note that we don't want to use MakeLabelForScope since that will include |
96 // the toolchain name in the label, and toolchain labels don't themselves | 96 // the toolchain name in the label, and toolchain labels don't themselves |
97 // have toolchain names. | 97 // have toolchain names. |
98 const SourceDir& input_dir = scope->GetSourceDir(); | 98 const SourceDir& input_dir = scope->GetSourceDir(); |
99 Label label(input_dir, args[0].string_value()); | 99 Label label(input_dir, args[0].string_value()); |
100 if (g_scheduler->verbose_logging()) | 100 if (g_scheduler->verbose_logging()) |
101 g_scheduler->Log("Generating toolchain", label.GetUserVisibleName(false)); | 101 g_scheduler->Log("Generating toolchain", label.GetUserVisibleName(false)); |
102 | 102 |
103 // This object will actually be copied into the one owned by the toolchain | 103 // This object will actually be copied into the one owned by the toolchain |
104 // manager, but that has to be done in the lock. | 104 // manager, but that has to be done in the lock. |
105 Toolchain toolchain(label); | 105 Toolchain toolchain(scope->settings(), label); |
106 | 106 |
107 Scope block_scope(scope); | 107 Scope block_scope(scope); |
108 block_scope.SetProperty(&kToolchainPropertyKey, &toolchain); | 108 block_scope.SetProperty(&kToolchainPropertyKey, &toolchain); |
109 block->ExecuteBlockInScope(&block_scope, err); | 109 block->ExecuteBlockInScope(&block_scope, err); |
110 block_scope.SetProperty(&kToolchainPropertyKey, NULL); | 110 block_scope.SetProperty(&kToolchainPropertyKey, NULL); |
111 if (err->has_error()) | 111 if (err->has_error()) |
112 return Value(); | 112 return Value(); |
113 if (!block_scope.CheckForUnusedVars(err)) | 113 if (!block_scope.CheckForUnusedVars(err)) |
114 return Value(); | 114 return Value(); |
115 | 115 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return Value(); | 297 return Value(); |
298 | 298 |
299 Scope::KeyValueMap values; | 299 Scope::KeyValueMap values; |
300 block_scope.GetCurrentScopeValues(&values); | 300 block_scope.GetCurrentScopeValues(&values); |
301 toolchain->args() = values; | 301 toolchain->args() = values; |
302 | 302 |
303 return Value(); | 303 return Value(); |
304 } | 304 } |
305 | 305 |
306 } // namespace functions | 306 } // namespace functions |
OLD | NEW |