blob: 06b9d14693272cd9ffd5a9fc5d9b81dc124c910e [file] [log] [blame]
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/host.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
group("banjo") {
public_deps = [ ":banjo_bin($host_toolchain)" ]
}
group("tests") {
testonly = true
public_deps = [ ":banjo_unittests($host_toolchain)" ]
}
rustc_binary("banjo_bin") {
edition = "2018"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:heck",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:pest",
"//third_party/rust_crates:pest_derive",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
"//third_party/rust_crates:thiserror",
]
source_root = "src/main.rs"
}
rustc_library("banjo_lib") {
edition = "2018"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:heck",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:pest",
"//third_party/rust_crates:pest_derive",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
"//third_party/rust_crates:thiserror",
]
source_root = "src/lib.rs"
}
if (host_toolchain == current_toolchain) {
rustc_test("banjo_unittests") {
edition = "2018"
deps = [
":banjo_bin",
":banjo_lib($host_toolchain)",
"//third_party/rust_crates:pest",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
]
source_root = "test/tests.rs"
}
}