blob: dfbda44e9d954db276c802d008f790899f036b26 [file] [log] [blame]
# Copyright 2020 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")
rustc_library("moniker") {
with_unit_tests = true
edition = "2024"
deps = [
"//src/sys/lib/cm_rust",
"//src/sys/lib/cm_types",
"//third_party/rust_crates:flyweights",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/child_name.rs",
"src/error.rs",
"src/extended_moniker.rs",
"src/lib.rs",
"src/moniker.rs",
]
# Some host tools use serde to serialize/deserialize moniker types. This
# dependency is guarded in code via #[cfg(feature = "serde")] and
# #[cfg_attr(feature = "serde", ...)] to prevent serde dependencies in
# non-host builds.
features = []
if (is_host) {
features += [ "serde" ]
deps += [
"//third_party/rust_crates:schemars",
"//third_party/rust_crates:serde",
]
sources += [ "src/serde_ext.rs" ]
}
}
fuchsia_unittest_package("moniker-tests") {
deps = [ ":moniker_test" ]
}
group("tests") {
testonly = true
deps = [ ":moniker-tests" ]
}