blob: c20ee3fec37f7032e740c10a9131da14774c8855 [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/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp",
"//sdk/fidl/fuchsia.hardware.serialimpl:fuchsia.hardware.serialimpl_cpp",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/outgoing/cpp:cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
]
# 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",
"//sdk/lib/async_patterns/testing/cpp:cpp",
"//sdk/lib/driver/testing/cpp:gtest_fixture",
"//src/lib/fxl/test:gtest_main",
"//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",
]
}