| # 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. | |
| # This file was generated by the `fx create` command. The template | |
| # is located at `//tools/create/templates/driver-default/BUILD.gn.tmpl-cpp`. | |
| # If you find something broken, we are eager to review fixes. | |
| import("//build/bind/bind.gni") | |
| import("//build/components.gni") | |
| import("//build/drivers.gni") | |
| import("//build/test.gni") | |
| group("usb-fastboot-function") { | |
| deps = [ ":pkg" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":usb-fastboot-function-test" ] | |
| } | |
| fuchsia_driver_dml("usb-fastboot-function-dml") { | |
| dml = "meta/usb-fastboot-function.dml" | |
| driver_name = "usb-fastboot-function" | |
| } | |
| driver_bind_rules("bind") { | |
| dml_label = ":usb-fastboot-function-dml" | |
| bind_output = "usb-fastboot-function.bindbc" | |
| deps = [ | |
| "//src/devices/bind/fuchsia.google.platform.usb", | |
| "//src/devices/bind/fuchsia.usb", | |
| "//src/devices/bind/fuchsia.usb.comm", | |
| ] | |
| } | |
| source_set("usb-fastboot-function-common") { | |
| sources = [ | |
| "usb_fastboot_function.cc", | |
| "usb_fastboot_function.h", | |
| ] | |
| public_deps = [ | |
| ":bind", | |
| "//sdk/fidl/fuchsia.hardware.fastboot:fuchsia.hardware.fastboot_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/fbl", | |
| "//zircon/system/ulib/fzl", | |
| "//zircon/system/ulib/inspect", | |
| "//zircon/system/ulib/sync", | |
| "//zircon/system/ulib/trace", | |
| "//zircon/system/ulib/zircon-internal", | |
| "//zircon/system/ulib/zx", | |
| ] | |
| } | |
| fuchsia_cc_driver("driver") { | |
| output_name = "usb-fastboot-function" | |
| deps = [ ":usb-fastboot-function-common" ] | |
| } | |
| fuchsia_driver_component("component") { | |
| component_name = "usb-fastboot-function" | |
| deps = [ ":driver" ] | |
| info = "meta/usb_fastboot_function-info.json" | |
| dml_label = ":usb-fastboot-function-dml" | |
| } | |
| fuchsia_driver_package("pkg") { | |
| package_name = "usb-fastboot-function" | |
| driver_components = [ ":component" ] | |
| } | |
| test("usb-fastboot-function-test-bin") { | |
| sources = [ "unit-tests.cc" ] | |
| deps = [ | |
| ":usb-fastboot-function-common", | |
| "//sdk/fidl/fuchsia.hardware.fastboot:fuchsia.hardware.fastboot_cpp_testing", | |
| "//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/devices/usb/lib/usb-inspect", | |
| "//src/lib/fxl/test:gtest_main", | |
| ] | |
| } | |
| fuchsia_unittest_package("usb-fastboot-function-test") { | |
| test_specs = { | |
| log_settings = { | |
| # VMO fails to be unregistered during test fixture destruction due to the | |
| # error: | |
| # | |
| # "Failed to unregister vmo FIDL operation failed due to dispatcher error, | |
| # status: ZX_ERR_CANCELED (-23)". | |
| # | |
| # Ignore this error for now since it doesn't seem to be the issue of the | |
| # driver. | |
| max_severity = "ERROR" | |
| } | |
| } | |
| deps = [ ":usb-fastboot-function-test-bin" ] | |
| } |