summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-09-25 18:45:09 -0700
committerBert Belder <bertbelder@gmail.com>2018-09-26 10:25:58 -0700
commit47e8242b2912e36535ed2194de75b10802f230b1 (patch)
tree0bb0010bb4f3b5360d7fec5009aaafabcf48aa2a
parentf10012facfa989ba9c9920dcae369c9769231a59 (diff)
build: add support for rustc_wrapper
Fixes #690.
-rw-r--r--build_extra/rust/rust.gni12
1 files changed, 11 insertions, 1 deletions
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni
index 94f7acbe9..dc9c408d2 100644
--- a/build_extra/rust/rust.gni
+++ b/build_extra/rust/rust.gni
@@ -2,6 +2,10 @@ declare_args() {
# Absolute path of rust build files.
rust_build = "//build_extra/rust/"
+ # Wrapper executable for rustc invocations. This can be used for a caching
+ # utility, e.g. sccache.
+ rustc_wrapper = ""
+
# treat the warnings in rust files as errors
rust_treat_warnings_as_errors = true
}
@@ -114,7 +118,13 @@ template("run_rustc") {
]
depfile = "$out_dir/$crate_name$crate_suffix.d"
- args = [
+ if (rustc_wrapper != "") {
+ args = [ rustc_wrapper ]
+ } else {
+ args = []
+ }
+
+ args += [
"rustc",
rebase_path(source_root, root_build_dir),
"--crate-name=$crate_name",