| # 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") | |
| fuchsia_driver_dml("usb-zero-function-dml") { | |
| dml = "meta/usb-zero-function.dml" | |
| driver_name = "usb-zero-function" | |
| } | |
| driver_bind_rules("usb_zero_function_bind") { | |
| dml_label = ":usb-zero-function-dml" | |
| 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.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", | |
| "//src/lib/fuchsia-runtime", | |
| "//third_party/rust_crates:enumn", | |
| "//third_party/rust_crates:futures", | |
| "//third_party/rust_crates:log", | |
| "//third_party/rust_crates:zerocopy", | |
| ] | |
| test_deps = [ "//src/lib/fuchsia" ] | |
| } | |
| fuchsia_driver_component("usb-zero-function") { | |
| dml_label = ":usb-zero-function-dml" | |
| component_name = "usb-zero-function" | |
| deps = [ | |
| ":usb-zero-function-driver", | |
| ":usb_zero_function_bind", | |
| ] | |
| 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", | |
| ] | |
| } |