diff options
Diffstat (limited to 'build_extra/rust/rust.gni')
| -rw-r--r-- | build_extra/rust/rust.gni | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index 85959e921..aaf111676 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -57,6 +57,7 @@ template("run_rustc") { "is_test", "source_root", "testonly", + "treat_warnings_as_errors", ]) if (!defined(crate_name)) { crate_name = target_name @@ -64,6 +65,10 @@ template("run_rustc") { if (!defined(is_test)) { is_test = false } + if (!defined(treat_warnings_as_errors)) { + # Use global setting if not explicitly specified for this target. + treat_warnings_as_errors = rust_treat_warnings_as_errors + } sources = [ source_root, @@ -76,7 +81,7 @@ template("run_rustc") { "--crate-type=$crate_type", ] - if (rust_treat_warnings_as_errors) { + if (treat_warnings_as_errors) { args += [ "-Dwarnings" ] } @@ -254,6 +259,7 @@ template("rust_crate") { "is_test", "source_root", "testonly", + "treat_warnings_as_errors", ]) } |
