blob: 3599b8aa10de4fb7e5be9c680b72b34ad9e88776 [file] [log] [blame]
# 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"
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_cpp",
"//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/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
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"
manifest = "meta/bt-transport-uart.cml"
}
fuchsia_driver_package("uart") {
driver_components = [ ":bt-transport-uart" ]
}
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",
]
}
fuchsia_unittest_package("bt-transport-uart-tests") {
deps = [ ":tests_executable" ]
}
group("tests") {
testonly = true
deps = [
":bt-transport-uart-tests",
":bt_transport_uart_bind_test",
]
}