Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tools/gn/function_toolchain.cc

Issue 269723006: Add get_target_outputs function to GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 Scope block_scope(scope); 112 Scope block_scope(scope);
113 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); 113 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
114 block->ExecuteBlockInScope(&block_scope, err); 114 block->ExecuteBlockInScope(&block_scope, err);
115 block_scope.SetProperty(&kToolchainPropertyKey, NULL); 115 block_scope.SetProperty(&kToolchainPropertyKey, NULL);
116 if (err->has_error()) 116 if (err->has_error())
117 return Value(); 117 return Value();
118 118
119 if (!block_scope.CheckForUnusedVars(err)) 119 if (!block_scope.CheckForUnusedVars(err))
120 return Value(); 120 return Value();
121 121
122 scope->settings()->build_settings()->ItemDefined(toolchain.PassAs<Item>()); 122 // Save this target for the file.
123 Scope::ItemVector* collector = scope->GetItemCollector();
124 if (!collector) {
125 *err = Err(function, "Can't define a toolchain in this context.");
126 return Value();
127 }
128 collector->push_back(new scoped_ptr<Item>(toolchain.PassAs<Item>()));
123 return Value(); 129 return Value();
124 } 130 }
125 131
126 // tool ------------------------------------------------------------------------ 132 // tool ------------------------------------------------------------------------
127 133
128 const char kTool[] = "tool"; 134 const char kTool[] = "tool";
129 const char kTool_HelpShort[] = 135 const char kTool_HelpShort[] =
130 "tool: Specify arguments to a toolchain tool."; 136 "tool: Specify arguments to a toolchain tool.";
131 const char kTool_Help[] = 137 const char kTool_Help[] =
132 "tool: Specify arguments to a toolchain tool.\n" 138 "tool: Specify arguments to a toolchain tool.\n"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return Value(); 307 return Value();
302 308
303 Scope::KeyValueMap values; 309 Scope::KeyValueMap values;
304 block_scope.GetCurrentScopeValues(&values); 310 block_scope.GetCurrentScopeValues(&values);
305 toolchain->args() = values; 311 toolchain->args() = values;
306 312
307 return Value(); 313 return Value();
308 } 314 }
309 315
310 } // namespace functions 316 } // namespace functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698