| # 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/fuzz.gni") |
| import("//src/connectivity/bluetooth/core/bt-host/build/bt_gtest_package.gni") |
| |
| driver_bind_rules("bt_host_bind") { |
| rules = "bt_host.bind" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.bluetooth" ] |
| } |
| |
| fuchsia_driver("fuchsia_driver") { |
| output_name = "bt-host" |
| |
| sources = [ "driver.cc" ] |
| |
| deps = [ |
| ":bt_host_bind", |
| ":sources", |
| "//sdk/lib/syslog/cpp:backend", |
| "//third_party/pigweed/backends/pw_log:dfv1", |
| ] |
| } |
| |
| fuchsia_driver_component("driver") { |
| component_name = "bt-host" |
| deps = [ ":fuchsia_driver" ] |
| info = "driver-info.json" |
| manifest = "meta/driver.cml" |
| } |
| |
| source_set("sources") { |
| sources = [ |
| "host.cc", |
| "host.h", |
| "host_device.cc", |
| "host_device.h", |
| ] |
| |
| deps = [ |
| "//src/devices/lib/driver", |
| "//third_party/pigweed/backends/pw_random:zircon_random_generator", |
| "//zircon/system/ulib/inspect", |
| ] |
| |
| public_deps = [ |
| ":stack", |
| "fidl", |
| "//sdk/banjo/fuchsia.hardware.bt.vendor:fuchsia.hardware.bt.vendor_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp_wire", |
| "//sdk/lib/fit", |
| "//src/connectivity/bluetooth/fidl:host_hlcpp", |
| "//src/connectivity/bluetooth/lib/fidl", |
| "//src/lib/ddk", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| group("stack") { |
| public_deps = [ |
| "att", |
| "common", |
| "controllers", |
| "gap", |
| "gatt", |
| "hci", |
| "hci-spec", |
| "l2cap", |
| "sco", |
| "sdp", |
| "sm", |
| "socket", |
| "transport", |
| ] |
| } |
| |
| # TODO(armansito): Enable debug assertions by default from here for all package |
| # dependencies when there is a way for it. |
| fuchsia_driver_package("bt-host") { |
| driver_components = [ ":driver" ] |
| # This package is reachable from //bundles/packages/prod:all |
| } |
| |
| # See https://fuchsia.dev/fuchsia-src/development/testing/fuzzing/build-a-fuzzer?hl=en#fx-set |
| # for instructions on building the fuzzers package. |
| fuchsia_fuzzer_component("advertising-data-fuzzer-component") { |
| manifest = "common/meta/advertising_data_fuzzer.cml" |
| deps = [ "common:advertising_data_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("host-server-watch-peers-fuzzer-component") { |
| manifest = "fidl/meta/host_server_watch_peers_fuzzer.cml" |
| deps = [ "fidl:host_server_watch_peers_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("peer-cache-fuzzer-component") { |
| manifest = "gap/meta/peer_cache_fuzzer.cml" |
| deps = [ "gap:peer_cache_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("l2cap-fuzzer-component") { |
| manifest = "l2cap/meta/l2cap_fuzzer.cml" |
| deps = [ "l2cap:l2cap_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("basic-mode-rx-engine-fuzzer-component") { |
| manifest = "l2cap/meta/basic_mode_rx_engine_fuzzer.cml" |
| deps = [ "l2cap:basic_mode_rx_engine_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component( |
| "enhanced-retransmission-mode-engines-fuzzer-component") { |
| manifest = "l2cap/meta/enhanced_retransmission_mode_engines_fuzzer.cml" |
| deps = [ "l2cap:enhanced_retransmission_mode_engines_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("bredr-dynamic-channel-registry-fuzzer-component") { |
| manifest = "l2cap/meta/bredr_dynamic_channel_registry_fuzzer.cml" |
| deps = [ "l2cap:bredr_dynamic_channel_registry_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("channel-configuration-fuzzer-component") { |
| manifest = "l2cap/meta/channel_configuration_fuzzer.cml" |
| deps = [ "l2cap:channel_configuration_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("common-handler-fuzzer-component") { |
| manifest = "l2cap/meta/common_handler_fuzzer.cml" |
| deps = [ "l2cap:common_handler_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("data-element-fuzzer-component") { |
| manifest = "sdp/meta/data_element_fuzzer.cml" |
| deps = [ "sdp:data_element_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("pdu-fuzzer-component") { |
| manifest = "sdp/meta/pdu_fuzzer.cml" |
| deps = [ "sdp:pdu_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("valid-packet-reader-fuzzer-component") { |
| manifest = "sm/meta/valid_packet_reader_fuzzer.cml" |
| deps = [ "sm:valid_packet_reader_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("fuzzers") { |
| package_name = "bt-host-fuzzers" |
| cpp_fuzzer_components = [ |
| ":advertising-data-fuzzer-component", |
| ":host-server-watch-peers-fuzzer-component", |
| ":peer-cache-fuzzer-component", |
| ":l2cap-fuzzer-component", |
| ":basic-mode-rx-engine-fuzzer-component", |
| ":enhanced-retransmission-mode-engines-fuzzer-component", |
| ":bredr-dynamic-channel-registry-fuzzer-component", |
| ":channel-configuration-fuzzer-component", |
| ":common-handler-fuzzer-component", |
| ":data-element-fuzzer-component", |
| ":pdu-fuzzer-component", |
| ":valid-packet-reader-fuzzer-component", |
| ] |
| } |
| |
| source_set("device_tests") { |
| testonly = true |
| |
| sources = [ "host_unittest.cc" ] |
| |
| deps = [ |
| ":sources", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| bt_gtest_package("bt-host-device-tests") { |
| deps = [ ":device_tests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bt-host-device-tests", |
| ":fuzzers", |
| "att:bt-host-att-tests", |
| "common:bt-host-common-tests", |
| "controllers:bt-host-controllers-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", |
| "transport:bt-host-transport-tests", |
| ] |
| } |