blob: 07808b2dc69031d6b13b20359c5a47a67f7fd035 [file] [log] [blame] [edit]
# Copyright 2023 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/components.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
zbi_lib_sources = [
"src/lib.rs",
"src/zbi_format.rs",
]
rustc_library("zbi-rs") {
name = "zbi"
version = "0.1.0"
edition = "2021"
deps = [
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:zerocopy",
]
non_rust_deps = [ "//sdk/lib/zbi-format" ]
sources = zbi_lib_sources
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
# This is just for unit tests to have different name
# Since `with_unit_tests = true` produces binary that is in conflict with c implementation
rustc_test("zbi-rs-test") {
version = "0.1.0"
edition = "2021"
testonly = true
output_name = "firmware_zbi_rs_test"
deps = [
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:zerocopy",
]
non_rust_deps = [ "//sdk/lib/zbi-format" ]
sources = zbi_lib_sources
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_unittest_package("zbi-rs-lib-unit-tests") {
deps = [
":zbi-rs-test",
":zbi-rs-test($host_toolchain)",
]
}
group("tests") {
testonly = true
public_deps = [ ":zbi-rs-lib-unit-tests" ]
}