blob: 3548b79ae9a8dd9df9e009414a35bcafd17cb2be [file] [log] [blame]
# Copyright 2018 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/config/fuchsia/rules.gni")
import("//build/fuzzing/fuzzer.gni")
import("//src/sys/build/components.gni")
bind_rules("bt_host_bind") {
rules = "bt_host.bind"
output = "bt_host_bind.h"
tests = "tests.json"
deps = [ "//src/devices/bind/fuchsia.bluetooth" ]
}
driver_module("driver") {
output_name = "bt-host"
sources = [ "driver.cc" ]
deps = [
":bt_host_bind",
":sources",
"//sdk/lib/syslog/cpp:backend_legacy",
]
}
source_set("sources") {
sources = [
"gatt_remote_service_device.cc",
"gatt_remote_service_device.h",
"host.cc",
"host.h",
"host_device.cc",
"host_device.h",
]
deps = [
"//src/devices/lib/driver",
"//zircon/system/ulib/inspect",
]
public_deps = [
":stack",
"fidl",
"//sdk/banjo/fuchsia.hardware.bt.gattsvc",
"//sdk/banjo/fuchsia.hardware.bt.vendor",
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_c",
"//src/connectivity/bluetooth/fidl:host",
"//src/connectivity/bluetooth/lib/fidl",
"//src/lib/ddk",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//sdk/lib/fit",
"//src/lib/ddk:ddk-deprecated-binding-headers",
"//src/lib/fxl",
"//zircon/public/lib/fbl",
"//zircon/public/lib/zx",
"//zircon/system/ulib/trace:trace-driver",
]
}
group("stack") {
public_deps = [
"att",
"common",
"gap",
"gatt",
"hci",
"hci-spec",
"l2cap",
"sco",
"sdp",
"sm",
"socket",
]
}
# TODO(armansito): Enable debug assertions by default from here for all package
# dependencies when there is a way for it.
fuchsia_system_package("bt-host") {
deps = [ ":driver" ]
# This package is reachable from //garnet/packages/prod:all
allowed_in_extra_deps = true
}
# See https://fuchsia.dev/fuchsia-src/development/testing/fuzzing/build-a-fuzzer?hl=en#fx-set
# for instructions on building the fuzzers package.
fuzzers_package("fuzzers") {
package_name = "bt-host-fuzzers"
fuzzers = [
"common:advertising_data_fuzzer",
"fidl:host_server_watch_peers_fuzzer",
"gap:peer_cache_fuzzer",
"hci:read_acl_data_packet_fuzzer",
"hci:read_command_event_packet_fuzzer",
"l2cap:l2cap_fuzzer",
"l2cap:basic_mode_rx_engine_fuzzer",
"l2cap:enhanced_retransmission_mode_engines_fuzzer",
"l2cap:bredr_dynamic_channel_registry_fuzzer",
"l2cap:channel_configuration_fuzzer",
"l2cap:common_handler_fuzzer",
"sdp:data_element_fuzzer",
"sdp:pdu_fuzzer",
"sm:valid_packet_reader_fuzzer",
]
}
group("tests") {
testonly = true
deps = [
":fuzzers",
"att:bt-host-att-tests",
"common:bt-host-common-tests",
"fidl:bt-host-fidl-tests",
"gap:bt-host-gap-tests",
"gatt:bt-host-gatt-tests",
"hci:bt-host-hci-tests",
"hci-spec:bt-host-hci-spec-tests",
"l2cap:bt-host-l2cap-tests",
"sco:bt-host-sco-tests",
"sdp:bt-host-sdp-tests",
"sm:bt-host-sm-tests",
"socket:bt-host-socket-tests",
"testing:bt-host-testing-tests",
]
}