blob: 6c320b8fed5ce691ecfa65635e0af7b66e63ccfe [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")
rustc_binary("banjo_bin") {
edition = "2018"
deps = [
"//third_party/rust_crates:failure",
"//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_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
]
source_root = "src/main.rs"
}
rustc_library("banjo_lib") {
edition = "2018"
deps = [
"//third_party/rust_crates:failure",
"//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_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
]
source_root = "src/lib.rs"
}
if (host_toolchain == current_toolchain) {
rustc_library("banjo_unittests") {
edition = "2018"
with_unit_tests = true
testonly = true
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"
}
}
group("banjo") {
public_deps = [
":banjo_bin($host_toolchain)",
]
}