| # Copyright 2022 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") | |
| import("//build/test.gni") | |
| fuchsia_driver_dml("usb-adb-function-dml") { | |
| dml = "meta/usb-adb-function.dml" | |
| driver_name = "usb-adb-function" | |
| } | |
| driver_bind_rules("usb_adb_bind") { | |
| dml_label = ":usb-adb-function-dml" | |
| bind_output = "usb-adb-function.bindbc" | |
| tests = "meta/bind-tests.json" | |
| deps = [ | |
| "//src/devices/bind/fuchsia.google.platform.usb", | |
| "//src/devices/bind/fuchsia.usb", | |
| "//src/devices/bind/fuchsia.usb.comm", | |
| ] | |
| } | |
| source_set("usb-adb-common") { | |
| sources = [ | |
| "adb-function.cc", | |
| "adb-function.h", | |
| ] | |
| public_deps = [ | |
| ":usb_adb_bind", | |
| "//sdk/fidl/fuchsia.hardware.adb:fuchsia.hardware.adb_cpp", | |
| "//sdk/fidl/fuchsia.hardware.usb.descriptor:fuchsia.hardware.usb.descriptor_cpp", | |
| "//sdk/fidl/fuchsia.hardware.usb.endpoint:fuchsia.hardware.usb.endpoint_cpp", | |
| "//sdk/fidl/fuchsia.hardware.usb.function:fuchsia.hardware.usb.function_cpp", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/driver/compat/cpp", | |
| "//sdk/lib/driver/component/cpp", | |
| "//sdk/lib/driver/devfs/cpp", | |
| "//src/devices/usb/lib/usb:peripheral", | |
| "//src/devices/usb/lib/usb:usb-dfv2-compat-logging", | |
| "//src/devices/usb/lib/usb-endpoint:usb-endpoint-client-dfv2-compat-logging", | |
| "//src/devices/usb/lib/usb-inspect", | |
| "//zircon/system/ulib/inspect", | |
| "//zircon/system/ulib/sync", | |
| "//zircon/system/ulib/sync:sync-cpp", | |
| "//zircon/system/ulib/trace", | |
| ] | |
| } | |
| fuchsia_cc_driver("usb-adb-function-driver") { | |
| output_name = "usb-adb-function" | |
| deps = [ ":usb-adb-common" ] | |
| } | |
| fuchsia_driver_component("usb-adb-function") { | |
| component_name = "usb-adb-function" | |
| dml_label = ":usb-adb-function-dml" | |
| deps = [ | |
| ":usb-adb-common", | |
| ":usb-adb-function-driver", | |
| ":usb_adb_bind", | |
| ] | |
| info = "meta/usb-adb-function-info.json" | |
| } | |
| fuchsia_driver_package("package") { | |
| package_name = "usb-adb-function" | |
| driver_components = [ ":usb-adb-function" ] | |
| } | |
| test("usb-adb-test") { | |
| sources = [ "adb-function-test.cc" ] | |
| deps = [ | |
| ":usb-adb-common", | |
| "//sdk/fidl/fuchsia.hardware.adb:fuchsia.hardware.adb_cpp", | |
| "//sdk/lib/async-default", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/driver/testing/cpp", | |
| "//sdk/lib/inspect/testing/cpp", | |
| "//src/devices/usb/lib/usb:usb-dfv2-compat-logging", | |
| "//src/devices/usb/lib/usb-endpoint:fake-usb-endpoint-server", | |
| "//src/lib/fxl/test:gtest_main", | |
| ] | |
| } | |
| fuchsia_unittest_package("usb-adb-unittest") { | |
| deps = [ ":usb-adb-test" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":usb-adb-unittest", | |
| ":usb_adb_bind_test", | |
| ] | |
| } |