| # Copyright 2026 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/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| |
| driver_bind_rules("usb_zero_function_bind") { |
| rules = "meta/usb-zero-function.bind" |
| bind_output = "usb-zero-function.bindbc" |
| tests = "meta/bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.usb" ] |
| } |
| |
| fuchsia_rust_driver("usb-zero-function-driver") { |
| output_name = "usb-zero-function" |
| edition = "2024" |
| with_unit_tests = true |
| source_root = "src/lib.rs" |
| sources = [ |
| "src/lib.rs", |
| "src/tests.rs", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_rust", |
| "//sdk/fidl/fuchsia.hardware.usb.descriptor:fuchsia.hardware.usb.descriptor_rust", |
| "//sdk/fidl/fuchsia.hardware.usb.endpoint:fuchsia.hardware.usb.endpoint_rust", |
| "//sdk/fidl/fuchsia.hardware.usb.function:fuchsia.hardware.usb.function_rust", |
| "//sdk/fidl/fuchsia.hardware.usb.request:fuchsia.hardware.usb.request_rust", |
| "//sdk/lib/driver/component/rust", |
| "//sdk/rust/zx", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:enumn", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| test_deps = [ "//src/lib/fuchsia" ] |
| } |
| |
| fuchsia_driver_component("usb-zero-function") { |
| component_name = "usb-zero-function" |
| deps = [ |
| ":usb-zero-function-driver", |
| ":usb_zero_function_bind", |
| ] |
| manifest = "meta/usb-zero-function.cml" |
| info = "meta/usb-zero-function-info.json" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "usb-zero-function" |
| driver_components = [ ":usb-zero-function" ] |
| } |
| |
| fuchsia_unittest_package("usb-zero-function-unittest-package") { |
| package_name = "usb-zero-function-unittest" |
| deps = [ ":usb-zero-function-driver_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":usb-zero-function-unittest-package", |
| ":usb_zero_function_bind_test", |
| ] |
| } |