mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
chore: introduce rust_treat_warnings_as_errors build arg
This commit is contained in:
parent
f46c271afc
commit
0ce7b6e870
2 changed files with 8 additions and 2 deletions
1
.gn
1
.gn
|
@ -30,6 +30,7 @@ default_args = {
|
||||||
is_component_build = false
|
is_component_build = false
|
||||||
symbol_level = 1
|
symbol_level = 1
|
||||||
treat_warnings_as_errors = false
|
treat_warnings_as_errors = false
|
||||||
|
rust_treat_warnings_as_errors = false
|
||||||
|
|
||||||
# https://cs.chromium.org/chromium/src/docs/ccache_mac.md
|
# https://cs.chromium.org/chromium/src/docs/ccache_mac.md
|
||||||
clang_use_chrome_plugins = false
|
clang_use_chrome_plugins = false
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
declare_args() {
|
declare_args() {
|
||||||
# Absolute path of rust build files.
|
# Absolute path of rust build files.
|
||||||
rust_build = "//build_extra/rust/"
|
rust_build = "//build_extra/rust/"
|
||||||
|
|
||||||
|
# treat the warnings in rust files as errors
|
||||||
|
rust_treat_warnings_as_errors = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_win) {
|
if (is_win) {
|
||||||
|
@ -67,14 +70,16 @@ template("run_rustc") {
|
||||||
]
|
]
|
||||||
script = "//tools/run_rustc.py"
|
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 = [
|
args = [
|
||||||
rebase_path(source_root, root_build_dir),
|
rebase_path(source_root, root_build_dir),
|
||||||
"--crate-name=$crate_name",
|
"--crate-name=$crate_name",
|
||||||
"--crate-type=$crate_type",
|
"--crate-type=$crate_type",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (rust_treat_warnings_as_errors) {
|
||||||
|
args += [ "-Dwarnings" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_win) {
|
if (!is_win) {
|
||||||
args += [ "--color=always" ]
|
args += [ "--color=always" ]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue