diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-30 17:27:03 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-30 17:27:03 +0000 |
commit | c5aba3b3472d3ba4b01b72167caac6b73a82f187 (patch) | |
tree | 8a727f8b82279ecdb7e3c98bbb4b1e2fdd050140 | |
parent | a21eaffd4da5aff9577b623efb4f21f22fd95755 (diff) | |
download | chromium_src-c5aba3b3472d3ba4b01b72167caac6b73a82f187.zip chromium_src-c5aba3b3472d3ba4b01b72167caac6b73a82f187.tar.gz chromium_src-c5aba3b3472d3ba4b01b72167caac6b73a82f187.tar.bz2 |
Rename GN tool's deps to depsformat.
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
-rw-r--r-- | tools/gn/function_toolchain.cc | 11 | ||||
-rw-r--r-- | tools/gn/ninja_toolchain_writer.cc | 5 | ||||
-rw-r--r-- | tools/gn/toolchain.h | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc index b748f36..b3821ec 100644 --- a/tools/gn/function_toolchain.cc +++ b/tools/gn/function_toolchain.cc @@ -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" @@ -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) || diff --git a/tools/gn/ninja_toolchain_writer.cc b/tools/gn/ninja_toolchain_writer.cc index 99087c6..dac5921 100644 --- a/tools/gn/ninja_toolchain_writer.cc +++ b/tools/gn/ninja_toolchain_writer.cc @@ -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; } diff --git a/tools/gn/toolchain.h b/tools/gn/toolchain.h index 45a14cc..4ab5412 100644 --- a/tools/gn/toolchain.h +++ b/tools/gn/toolchain.h @@ -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; |