summaryrefslogtreecommitdiff
path: root/build_extra/rust/rust.gni
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2018-08-13 17:04:18 +0900
committerRyan Dahl <ry@tinyclouds.org>2018-08-14 10:51:01 -0400
commit0ce7b6e8701bf00ec181a72df030404aecb5bc4a (patch)
treeb9c6a9e2acc615c2ae285e73cf09b46e8883789b /build_extra/rust/rust.gni
parentf46c271afcdf3e5e2e0d91889ed75fee888c9f0f (diff)
chore: introduce rust_treat_warnings_as_errors build arg
Diffstat (limited to 'build_extra/rust/rust.gni')
-rw-r--r--build_extra/rust/rust.gni9
1 files changed, 7 insertions, 2 deletions
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni
index c7e951c4b..ece21d6c0 100644
--- a/build_extra/rust/rust.gni
+++ b/build_extra/rust/rust.gni
@@ -1,6 +1,9 @@
declare_args() {
# Absolute path of rust build files.
rust_build = "//build_extra/rust/"
+
+ # treat the warnings in rust files as errors
+ rust_treat_warnings_as_errors = true
}
if (is_win) {
@@ -67,14 +70,16 @@ template("run_rustc") {
]
script = "//tools/run_rustc.py"
- # TODO: We want to apply "-Dwarnings" only when treat_warnings_as_errors is not false
- # https://github.com/denoland/deno/pull/379
args = [
rebase_path(source_root, root_build_dir),
"--crate-name=$crate_name",
"--crate-type=$crate_type",
]
+ if (rust_treat_warnings_as_errors) {
+ args += [ "-Dwarnings" ]
+ }
+
if (!is_win) {
args += [ "--color=always" ]
}