Chromium Code Reviews| Index: build/toolchain/gcc_toolchain.gni |
| diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni |
| index 41766ce920985f529a5312ef61122ce389739593..ca5560bc8c33cf94a683bd4d45a6859ae7ac0225 100644 |
| --- a/build/toolchain/gcc_toolchain.gni |
| +++ b/build/toolchain/gcc_toolchain.gni |
| @@ -4,6 +4,8 @@ |
| import("//build/config/nacl/config.gni") |
| import("//build/config/sanitizers/sanitizers.gni") |
| +import("//build/toolchain/ccache.gni") |
| +import("//build/toolchain/goma.gni") |
| import("//build/toolchain/toolchain.gni") |
| # This value will be inherited in the toolchain below. |
| @@ -84,6 +86,22 @@ template("gcc_toolchain") { |
| assert(defined(invoker.toolchain_os), |
| "gcc_toolchain() must specify a \"toolchain_os\"") |
| + # Allow toolchains to avoid ccache/goma explicitly |
|
brettw
2015/09/24 19:35:56
The phrasing of this comment seems weird to me, si
Dirk Pranke
2015/09/24 19:41:08
I'm not sure I understand you; we still want the c
tsniatowski
2015/09/24 19:48:26
This wouldn't do anything. As I understand it the
|
| + if (defined(invoker.use_ccache)) { |
| + use_ccache = invoker.use_ccache |
| + } |
| + if (defined(invoker.use_goma)) { |
| + use_goma = invoker.use_goma |
| + } |
| + if (use_goma) { |
| + assert(!use_ccache, "Goma and ccache can't be used together.") |
| + compiler_prefix = "$goma_dir/gomacc " |
| + } else if (use_ccache) { |
| + compiler_prefix = "ccache " |
| + } else { |
| + compiler_prefix = "" |
| + } |
| + |
| # This define changes when the toolchain changes, forcing a rebuild. |
| # Nothing should ever use this define. |
| if (defined(invoker.rebuild_define)) { |
| @@ -92,11 +110,8 @@ template("gcc_toolchain") { |
| rebuild_string = "" |
| } |
| - # We can't do string interpolation ($ in strings) on things with dots in |
| - # them. To allow us to use $cc below, for example, we create copies of |
| - # these values in our scope. |
| - cc = invoker.cc |
| - cxx = invoker.cxx |
| + cc = compiler_prefix + invoker.cc |
| + cxx = compiler_prefix + invoker.cxx |
| ar = invoker.ar |
| ld = invoker.ld |
| if (defined(invoker.readelf)) { |