blob: 66e846f1aa2fec9cae425b31e236153ef17310b7 [file] [log] [blame]
// simulation library for testing virtual devices
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_bt_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["system_bt_license"],
default_visibility: [
"//device:__subpackages__",
"//packages/modules/Bluetooth:__subpackages__",
],
}
cc_defaults {
name: "rootcanal_defaults",
defaults: [
"gd_defaults",
"gd_clang_tidy",
"gd_clang_tidy_ignore_android",
],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-fvisibility=hidden",
],
local_include_dirs: [
"include",
],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
],
generated_headers: [
"RootCanalGeneratedPackets_h",
"BluetoothGeneratedPackets_h",
"libbt_init_flags_bridge_header",
],
}
// Compile devices and device boutique into a single object to force the linker
// to pick all the symbols for static registration to work
cc_object {
name: "libbt-rootcanal-devices",
defaults: ["rootcanal_defaults"],
host_supported: true,
proprietary: true,
cflags: ["-fPIC"],
srcs: [
"model/devices/beacon.cc",
"model/devices/beacon_swarm.cc",
"model/devices/broken_adv.cc",
"model/devices/car_kit.cc",
"model/devices/classic.cc",
"model/devices/keyboard.cc",
"model/devices/loopback.cc",
"model/devices/scripted_beacon.cc",
"model/devices/sniffer.cc",
"model/setup/device_boutique.cc",
],
static_libs: [
"libscriptedbeaconpayload-protos-lite",
]
}
cc_library_static {
name: "libbt-rootcanal",
defaults: ["rootcanal_defaults"],
host_supported: true,
proprietary: true,
srcs: [
"model/controller/acl_connection.cc",
"model/controller/acl_connection_handler.cc",
"model/controller/dual_mode_controller.cc",
"model/controller/isochronous_connection_handler.cc",
"model/controller/le_advertiser.cc",
"model/controller/link_layer_controller.cc",
"model/controller/sco_connection.cc",
"model/controller/security_manager.cc",
"model/devices/device.cc",
"model/devices/device_properties.cc",
"model/devices/hci_device.cc",
"model/devices/link_layer_socket_device.cc",
"model/devices/remote_loopback_device.cc",
"model/hci/h4_data_channel_packetizer.cc",
"model/hci/h4_packetizer.cc",
"model/hci/h4_parser.cc",
"model/hci/hci_protocol.cc",
"model/hci/hci_socket_transport.cc",
"model/setup/async_manager.cc",
"model/setup/phy_layer_factory.cc",
"model/setup/test_channel_transport.cc",
"model/setup/test_command_handler.cc",
"model/setup/test_model.cc",
"net/posix/posix_async_socket.cc",
"net/posix/posix_async_socket_connector.cc",
"net/posix/posix_async_socket_server.cc",
":BluetoothPacketSources",
":BluetoothHciClassSources",
":BluetoothCryptoToolboxSources",
":libbt-rootcanal-devices",
],
export_include_dirs: [
"include",
".",
],
shared_libs: [
"liblog",
],
static_libs: [
"libjsoncpp",
],
}
cc_library_static {
name: "libscriptedbeaconpayload-protos-lite",
host_supported: true,
proprietary: true,
proto: {
export_proto_headers: true,
type: "lite",
},
srcs: ["model/devices/scripted_beacon_ble_payload.proto"],
}
// test-vendor unit tests for host
cc_test_host {
name: "rootcanal_test_host",
defaults: [
"clang_file_coverage",
"clang_coverage_bin",
],
srcs: [
"test/async_manager_unittest.cc",
"test/h4_parser_unittest.cc",
"test/posix_socket_unittest.cc",
"test/security_manager_unittest.cc",
],
header_libs: [
"libbluetooth_headers",
],
local_include_dirs: [
"include",
],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
],
shared_libs: [
"liblog",
],
static_libs: [
"libbt-rootcanal",
],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-fvisibility=hidden",
"-DLOG_NDEBUG=1",
],
target: {
darwin: {
enabled: false,
},
},
}
// Linux RootCanal Executable
cc_binary_host {
name: "root-canal",
defaults: ["rootcanal_defaults"],
srcs: [
"desktop/root_canal_main.cc",
"desktop/test_environment.cc",
],
header_libs: [
"libbluetooth_headers",
],
shared_libs: [
"liblog",
"libbacktrace",
],
static_libs: [
"libjsoncpp",
"libprotobuf-cpp-lite",
"libscriptedbeaconpayload-protos-lite",
"libbt-rootcanal",
"breakpad_client",
"libgflags",
],
sanitize: {
address: true,
all_undefined: true,
},
target: {
// TODO(b/181290178) remove it when sanitize option is supported by linux_bionic as well
linux_bionic: {
sanitize: {
address: false,
cfi: false,
all_undefined: false,
},
},
darwin: {
enabled: false,
},
},
}
genrule {
name: "RootCanalGeneratedPackets_h",
tools: [
"bluetooth_packetgen",
],
cmd: "$(location bluetooth_packetgen) --root_namespace=model --include=packages/modules/Bluetooth/tools/rootcanal --out=$(genDir) $(in)",
srcs: [
"packets/link_layer_packets.pdl",
],
out: [
"packets/link_layer_packets.h",
],
}
// bt_vhci_forwarder in cuttlefish depends on this H4Packetizer implementation.
cc_library_static {
name: "h4_packetizer_lib",
vendor: true,
defaults: [
"gd_defaults",
],
srcs: [
"model/hci/h4_packetizer.cc",
"model/hci/h4_parser.cc",
"model/hci/hci_protocol.cc",
],
local_include_dirs: [
"include",
],
export_include_dirs: [
"include",
".",
],
generated_headers: [
"libbt_init_flags_bridge_header",
],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
],
}