| # Copyright 2019 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/rust/rustc_library.gni") |
| import("//build/rust/rustc_macro.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_library("cm_rust") { |
| with_unit_tests = true |
| deps = [ |
| ":cm_rust_derive", |
| "//sdk/fidl/fuchsia.data:fuchsia.data-rustc", |
| "//sdk/fidl/fuchsia.io2:fuchsia.io2-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/from-enum", |
| "//src/sys/lib/cm_fidl_validator", |
| "//src/sys/lib/cm_types", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/data.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| rustc_macro("cm_rust_derive") { |
| deps = [ |
| "//third_party/rust_crates:darling", |
| "//third_party/rust_crates:proc-macro2", |
| "//third_party/rust_crates:quote", |
| "//third_party/rust_crates:syn", |
| ] |
| |
| source_root = "src/macro.rs" |
| sources = [ "src/macro.rs" ] |
| } |
| |
| fuchsia_unittest_package("cm_rust_tests") { |
| manifest = "meta/cm_rust_tests.cmx" |
| deps = [ ":cm_rust_test" ] |
| test_specs = { |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":cm_rust_tests" ] |
| } |