Skip to content

Commit

Permalink
Rename GN tool's deps to depsformat.
Browse files Browse the repository at this point in the history
This avoids collisions with the "deps" list of a toolchain.

R=noelallen@chromium.org

Review URL: https://codereview.chromium.org/361503003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280619 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Jun 30, 2014
1 parent a21eaff commit c5aba3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 9 additions & 2 deletions tools/gn/function_toolchain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,12 @@ const char kTool_Help[] =
" they work. Don't forget to backslash-escape $ required by Ninja to\n"
" prevent GN from doing variable expansion.\n"
"\n"
" command, depfile, deps, description, pool, restat, rspfile,\n"
" command, depfile, depsformat, description, pool, restat, rspfile,\n"
" rspfile_content\n"
"\n"
" (Note that GN uses \"depsformat\" for Ninja's \"deps\" variable to\n"
" avoid confusion with dependency lists.)\n"
"\n"
" Additionally, lib_prefix and lib_dir_prefix may be used for the link\n"
" tools. These strings will be prepended to the libraries and library\n"
" search directories, respectively, because linkers differ on how to\n"
Expand Down Expand Up @@ -236,7 +239,11 @@ Value RunTool(Scope* scope,
Toolchain::Tool t;
if (!ReadString(block_scope, "command", &t.command, err) ||
!ReadString(block_scope, "depfile", &t.depfile, err) ||
!ReadString(block_scope, "deps", &t.deps, err) ||
// TODO(brettw) delete this once we rename "deps" -> "depsformat" in
// the toolchain definitions. This will avoid colliding with the
// toolchain's "deps" list. For now, accept either.
!ReadString(block_scope, "deps", &t.depsformat, err) ||
!ReadString(block_scope, "depsformat", &t.depsformat, err) ||
!ReadString(block_scope, "description", &t.description, err) ||
!ReadString(block_scope, "lib_dir_prefix", &t.lib_dir_prefix, err) ||
!ReadString(block_scope, "lib_prefix", &t.lib_prefix, err) ||
Expand Down
5 changes: 4 additions & 1 deletion tools/gn/ninja_toolchain_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ void NinjaToolchainWriter::WriteRules() {
out_ << indent << " " STRINGIZE(name) " = " << tool.name << std::endl;
WRITE_ARG(command);
WRITE_ARG(depfile);
WRITE_ARG(deps);
WRITE_ARG(description);
WRITE_ARG(pool);
WRITE_ARG(restat);
WRITE_ARG(rspfile);
WRITE_ARG(rspfile_content);
#undef WRITE_ARG

// Deps is called "depsformat" in GN to avoid confusion with dependencies.
if (!tool.depsformat.empty()) \
out_ << indent << " deps = " << tool.depsformat << std::endl;
}
out_ << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/gn/toolchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Toolchain : public Item {

std::string command;
std::string depfile;
std::string deps;
std::string depsformat;
std::string description;
std::string lib_dir_prefix;
std::string lib_prefix;
Expand Down

0 comments on commit c5aba3b

Please sign in to comment.