1// simulation library for testing virtual devices 2// ======================================================== 3cc_library_static { 4 name: "libbt-rootcanal", 5 defaults: [ 6 "gd_defaults", 7 "gd_clang_tidy", 8 ], 9 host_supported: true, 10 proprietary: true, 11 srcs: [ 12 "model/controller/acl_connection.cc", 13 "model/controller/acl_connection_handler.cc", 14 "model/controller/dual_mode_controller.cc", 15 "model/controller/le_advertiser.cc", 16 "model/controller/link_layer_controller.cc", 17 "model/controller/security_manager.cc", 18 "model/devices/beacon.cc", 19 "model/devices/beacon_swarm.cc", 20 "model/devices/broken_adv.cc", 21 "model/devices/car_kit.cc", 22 "model/devices/classic.cc", 23 "model/devices/device.cc", 24 "model/devices/device_properties.cc", 25 "model/devices/h4_packetizer.cc", 26 "model/devices/h4_protocol.cc", 27 "model/devices/hci_packetizer.cc", 28 "model/devices/hci_protocol.cc", 29 "model/devices/hci_socket_device.cc", 30 "model/devices/keyboard.cc", 31 "model/devices/link_layer_socket_device.cc", 32 "model/devices/loopback.cc", 33 "model/devices/polled_socket.cc", 34 "model/devices/remote_loopback_device.cc", 35 "model/devices/scripted_beacon.cc", 36 "model/devices/sniffer.cc", 37 "model/setup/async_manager.cc", 38 "model/setup/device_boutique.cc", 39 "model/setup/phy_layer_factory.cc", 40 "model/setup/test_channel_transport.cc", 41 "model/setup/test_command_handler.cc", 42 "model/setup/test_model.cc", 43 ":BluetoothPacketSources", 44 ":BluetoothHciClassSources", 45 ":BluetoothCommonSources", 46 ], 47 cflags: [ 48 "-fvisibility=hidden", 49 "-DHAS_NO_BDROID_BUILDCFG", 50 ], 51 local_include_dirs: [ 52 "include", 53 ], 54 export_include_dirs: [ 55 "include", 56 ".", 57 ], 58 generated_headers: [ 59 "RootCanalGeneratedPackets_h", 60 "BluetoothGeneratedPackets_h", 61 ], 62 include_dirs: [ 63 "system/bt", 64 "system/bt/gd", 65 ], 66 shared_libs: [ 67 "libbase", 68 "libchrome", 69 "liblog", 70 ], 71 static_libs: [ 72 "libbt-rootcanal-types", 73 "libscriptedbeaconpayload-protos-lite", 74 ], 75} 76 77cc_library_static { 78 name: "libscriptedbeaconpayload-protos-lite", 79 host_supported: true, 80 proprietary: true, 81 proto: { 82 export_proto_headers: true, 83 type: "lite", 84 }, 85 srcs: ["model/devices/scripted_beacon_ble_payload.proto"], 86} 87 88// test-vendor unit tests for host 89// ======================================================== 90cc_test_host { 91 name: "test-vendor_test_host", 92 defaults: [ 93 "libchrome_support_defaults", 94 "clang_file_coverage", 95 "clang_coverage_bin", 96 ], 97 srcs: [ 98 "test/async_manager_unittest.cc", 99 "test/security_manager_unittest.cc", 100 ], 101 header_libs: [ 102 "libbluetooth_headers", 103 ], 104 local_include_dirs: [ 105 "include", 106 ], 107 include_dirs: [ 108 "system/bt", 109 "system/bt/gd", 110 ], 111 shared_libs: [ 112 "liblog", 113 ], 114 static_libs: [ 115 "libbt-rootcanal-types", 116 "libbt-rootcanal", 117 ], 118 cflags: [ 119 "-fvisibility=hidden", 120 "-DLOG_NDEBUG=1", 121 ], 122} 123 124// Linux RootCanal Executable 125// ======================================================== 126cc_binary_host { 127 name: "root-canal", 128 defaults: [ 129 "libchrome_support_defaults", 130 "gd_clang_tidy", 131 ], 132 srcs: [ 133 "desktop/root_canal_main.cc", 134 "desktop/test_environment.cc", 135 ], 136 header_libs: [ 137 "libbluetooth_headers", 138 ], 139 local_include_dirs: [ 140 "include", 141 ], 142 include_dirs: [ 143 "system/bt", 144 "system/bt/gd", 145 ], 146 generated_headers: [ 147 "RootCanalGeneratedPackets_h", 148 "BluetoothGeneratedPackets_h", 149 ], 150 shared_libs: [ 151 "liblog", 152 "libbacktrace", 153 ], 154 static_libs: [ 155 "libbt-rootcanal-types", 156 "libprotobuf-cpp-lite", 157 "libscriptedbeaconpayload-protos-lite", 158 "libbt-rootcanal", 159 "breakpad_client", 160 ], 161 sanitize: { 162 address: true, 163 all_undefined: true, 164 }, 165} 166 167genrule { 168 name: "RootCanalGeneratedPackets_h", 169 tools: [ 170 "bluetooth_packetgen", 171 ], 172 cmd: "$(location bluetooth_packetgen) --root_namespace=model --include=system/bt/vendor_libs/test_vendor_lib --out=$(genDir) $(in)", 173 srcs: [ 174 "packets/link_layer_packets.pdl", 175 ], 176 out: [ 177 "packets/link_layer_packets.h", 178 ], 179} 180