Skip to content

Commit

Permalink
Fix some warnings (denoland#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored and ry committed Jul 21, 2018
1 parent 89c7554 commit 3563638
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build_extra/flatbuffers/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ config("flatbuffers_config") {
cflags = [
"-Wno-exit-time-destructors",
"-Wno-header-hygiene",

# TODO: rust branch of flatbuffers has this warning.
# This should be removed when the branch fixed.
"-Wno-return-type",
]
}
}
Expand Down
7 changes: 7 additions & 0 deletions build_extra/rust/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ rust_component("url") {

rust_component("percent_encoding") {
source_root = "$crates/registry/src/github.com-1ecc6299db9ec823/percent-encoding-1.0.1/lib.rs"
args = [
# TODO: Suppress some warnings at this moment
# This should be removed when it's fixed in servo/rust-url repository
# https://github.com/servo/rust-url/issues/455
"-Aunused-imports",
"-Adeprecated",
]
}

rust_component("matches") {
Expand Down
8 changes: 8 additions & 0 deletions build_extra/rust/rust.gni
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ template("run_rustc") {
outputs = []
script = "//tools/run_rustc.py"

# TODO: We want to apply "-Dwarnings" only when treat_warnings_as_errors is not false
# https://github.com/ry/deno/pull/379
args = [
rebase_path(source_root, root_build_dir),
"--crate-name=$crate_name",
"--crate-type=$crate_type",
]

if (!is_win) {
args += [ "--color=always" ]
}
Expand Down Expand Up @@ -116,6 +119,10 @@ template("run_rustc") {
}
}

if (defined(invoker.args)) {
args += invoker.args
}

if (!defined(deps)) {
deps = []
}
Expand Down Expand Up @@ -155,6 +162,7 @@ template("rust_component") {
"source_root",
"is_test",
"testonly",
"args",
])
if (!defined(invoker.crate_type)) {
crate_type = "rlib"
Expand Down

0 comments on commit 3563638

Please sign in to comment.