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

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

Issue 361503003: Rename GN tool's deps to depsformat. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | tools/gn/ninja_toolchain_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 " \"cc\", \"cxx\", \"objc\", \"objcxx\", \"asm\", \"alink\", \"solink\",\n" 166 " \"cc\", \"cxx\", \"objc\", \"objcxx\", \"asm\", \"alink\", \"solink\",\n"
167 " \"link\", \"stamp\", \"copy\"\n" 167 " \"link\", \"stamp\", \"copy\"\n"
168 "\n" 168 "\n"
169 "Command flags:\n" 169 "Command flags:\n"
170 "\n" 170 "\n"
171 " These variables may be specified in the { } block after the tool call.\n" 171 " These variables may be specified in the { } block after the tool call.\n"
172 " They are passed directly to Ninja. See the ninja documentation for how\n" 172 " They are passed directly to Ninja. See the ninja documentation for how\n"
173 " they work. Don't forget to backslash-escape $ required by Ninja to\n" 173 " they work. Don't forget to backslash-escape $ required by Ninja to\n"
174 " prevent GN from doing variable expansion.\n" 174 " prevent GN from doing variable expansion.\n"
175 "\n" 175 "\n"
176 " command, depfile, deps, description, pool, restat, rspfile,\n" 176 " command, depfile, depsformat, description, pool, restat, rspfile,\n"
177 " rspfile_content\n" 177 " rspfile_content\n"
178 "\n" 178 "\n"
179 " (Note that GN uses \"depsformat\" for Ninja's \"deps\" variable to\n"
180 " avoid confusion with dependency lists.)\n"
181 "\n"
179 " Additionally, lib_prefix and lib_dir_prefix may be used for the link\n" 182 " Additionally, lib_prefix and lib_dir_prefix may be used for the link\n"
180 " tools. These strings will be prepended to the libraries and library\n" 183 " tools. These strings will be prepended to the libraries and library\n"
181 " search directories, respectively, because linkers differ on how to\n" 184 " search directories, respectively, because linkers differ on how to\n"
182 " specify them.\n" 185 " specify them.\n"
183 "\n" 186 "\n"
184 " Note: On Mac libraries with names ending in \".framework\" will be\n" 187 " Note: On Mac libraries with names ending in \".framework\" will be\n"
185 " added to the link like with a \"-framework\" switch and the lib prefix\n" 188 " added to the link like with a \"-framework\" switch and the lib prefix\n"
186 " will be ignored.\n" 189 " will be ignored.\n"
187 "\n" 190 "\n"
188 "Example:\n" 191 "Example:\n"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Run the tool block. 232 // Run the tool block.
230 Scope block_scope(scope); 233 Scope block_scope(scope);
231 block->ExecuteBlockInScope(&block_scope, err); 234 block->ExecuteBlockInScope(&block_scope, err);
232 if (err->has_error()) 235 if (err->has_error())
233 return Value(); 236 return Value();
234 237
235 // Extract the stuff we need. 238 // Extract the stuff we need.
236 Toolchain::Tool t; 239 Toolchain::Tool t;
237 if (!ReadString(block_scope, "command", &t.command, err) || 240 if (!ReadString(block_scope, "command", &t.command, err) ||
238 !ReadString(block_scope, "depfile", &t.depfile, err) || 241 !ReadString(block_scope, "depfile", &t.depfile, err) ||
239 !ReadString(block_scope, "deps", &t.deps, err) || 242 // TODO(brettw) delete this once we rename "deps" -> "depsformat" in
243 // the toolchain definitions. This will avoid colliding with the
244 // toolchain's "deps" list. For now, accept either.
245 !ReadString(block_scope, "deps", &t.depsformat, err) ||
246 !ReadString(block_scope, "depsformat", &t.depsformat, err) ||
240 !ReadString(block_scope, "description", &t.description, err) || 247 !ReadString(block_scope, "description", &t.description, err) ||
241 !ReadString(block_scope, "lib_dir_prefix", &t.lib_dir_prefix, err) || 248 !ReadString(block_scope, "lib_dir_prefix", &t.lib_dir_prefix, err) ||
242 !ReadString(block_scope, "lib_prefix", &t.lib_prefix, err) || 249 !ReadString(block_scope, "lib_prefix", &t.lib_prefix, err) ||
243 !ReadString(block_scope, "pool", &t.pool, err) || 250 !ReadString(block_scope, "pool", &t.pool, err) ||
244 !ReadString(block_scope, "restat", &t.restat, err) || 251 !ReadString(block_scope, "restat", &t.restat, err) ||
245 !ReadString(block_scope, "rspfile", &t.rspfile, err) || 252 !ReadString(block_scope, "rspfile", &t.rspfile, err) ||
246 !ReadString(block_scope, "rspfile_content", &t.rspfile_content, err)) 253 !ReadString(block_scope, "rspfile_content", &t.rspfile_content, err))
247 return Value(); 254 return Value();
248 255
249 // Make sure there weren't any vars set in this tool that were unused. 256 // Make sure there weren't any vars set in this tool that were unused.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return Value(); 331 return Value();
325 332
326 Scope::KeyValueMap values; 333 Scope::KeyValueMap values;
327 block_scope.GetCurrentScopeValues(&values); 334 block_scope.GetCurrentScopeValues(&values);
328 toolchain->args() = values; 335 toolchain->args() = values;
329 336
330 return Value(); 337 return Value();
331 } 338 }
332 339
333 } // namespace functions 340 } // namespace functions
OLDNEW
« no previous file with comments | « no previous file | tools/gn/ninja_toolchain_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698