| # 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/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("bt_transport_uart_bind") { |
| rules = "bt_transport_uart.bind" |
| header_output = "bt_transport_uart_bind.h" |
| bind_output = "bt-transport-uart.bindbc" |
| tests = "bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.serial" ] |
| } |
| |
| source_set("common") { |
| sources = [ |
| "bt_transport_uart.cc", |
| "bt_transport_uart.h", |
| ] |
| |
| public_deps = [ |
| ":bt_transport_uart_bind", |
| "//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.serial:fuchsia.hardware.serial_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.serialimpl.async:fuchsia.hardware.serialimpl.async_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.serial:fuchsia.hardware.serial_c", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/sync", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| |
| # TODO(fxbug.dev/95833): This target uses the deprecated C bindings. |
| # Consider switching to the C++ bindings. See linked bug for details. |
| configs += [ "//build/c:fidl-deprecated-c-bindings" ] |
| } |
| |
| fuchsia_driver("bt-transport-uart-driver") { |
| output_name = "bt-transport-uart" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [] |
| deps = [ ":common" ] |
| } |
| |
| fuchsia_driver_component("bt-transport-uart") { |
| component_name = "bt-transport-uart" |
| deps = [ ":bt-transport-uart-driver" ] |
| info = "bt-transport-uart-info.json" |
| colocate = true |
| } |
| |
| executable("tests_executable") { |
| testonly = true |
| |
| output_name = "bt-transport-uart-tests" |
| |
| sources = [ "bt_transport_uart_unittest.cc" ] |
| |
| deps = [ |
| ":common", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| ] |
| |
| # TODO(fxbug.dev/95833): This target uses the deprecated C bindings. |
| # Consider switching to the C++ bindings. See linked bug for details. |
| configs += [ "//build/c:fidl-deprecated-c-bindings" ] |
| } |
| |
| fuchsia_unittest_package("bt-transport-uart-tests") { |
| deps = [ ":tests_executable" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bt-transport-uart-tests", |
| ":bt_transport_uart_bind_test", |
| ] |
| } |