Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 1 | // Bluetooth main HW module / shared library for target |
Bob Badour | 92ecf7c | 2021-02-12 18:05:29 -0800 | [diff] [blame] | 2 | package { |
| 3 | // See: http://go/android-license-faq |
| 4 | // A large-scale-change added 'default_applicable_licenses' to import |
| 5 | // all of the 'license_kinds' from "system_bt_license" |
| 6 | // to get the below license kinds: |
| 7 | // SPDX-license-identifier-Apache-2.0 |
| 8 | default_applicable_licenses: ["system_bt_license"], |
| 9 | } |
| 10 | |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 11 | filegroup { |
| 12 | name: "LibBluetoothSources", |
| 13 | srcs: [ |
| 14 | "bte_conf.cc", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 15 | "bte_init_cpp_logging.cc", |
| 16 | "bte_logmsg.cc", |
| 17 | "bte_main.cc", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 18 | "stack_config.cc", |
| 19 | ] |
| 20 | } |
| 21 | |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 22 | cc_library_static { |
| 23 | name: "libbte", |
| 24 | defaults: ["fluoride_defaults"], |
| 25 | srcs: [ |
| 26 | ":LibBluetoothSources", |
| 27 | ":LibBluetoothShimSources", |
| 28 | ], |
| 29 | include_dirs: [ |
| 30 | "packages/modules/Bluetooth/system", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 31 | "packages/modules/Bluetooth/system/gd", |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 32 | "packages/modules/Bluetooth/system/gd/rust/shim", |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 33 | "packages/modules/Bluetooth/system/bta/include", |
| 34 | "packages/modules/Bluetooth/system/bta/sys", |
| 35 | "packages/modules/Bluetooth/system/bta/dm", |
| 36 | "packages/modules/Bluetooth/system/btcore/include", |
| 37 | "packages/modules/Bluetooth/system/internal_include", |
| 38 | "packages/modules/Bluetooth/system/stack/include", |
| 39 | "packages/modules/Bluetooth/system/stack/l2cap", |
| 40 | "packages/modules/Bluetooth/system/stack/a2dp", |
| 41 | "packages/modules/Bluetooth/system/stack/btm", |
| 42 | "packages/modules/Bluetooth/system/stack/avdt", |
| 43 | "packages/modules/Bluetooth/system/udrv/include", |
| 44 | "packages/modules/Bluetooth/system/btif/include", |
| 45 | "packages/modules/Bluetooth/system/btif/co", |
| 46 | "packages/modules/Bluetooth/system/hci/include", |
| 47 | "packages/modules/Bluetooth/system/vnd/include", |
| 48 | "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include", |
| 49 | "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include", |
| 50 | "packages/modules/Bluetooth/system/utils/include", |
| 51 | "system/security/keystore/include", |
| 52 | "hardware/interfaces/keymaster/4.0/support/include", |
| 53 | ], |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 54 | shared_libs: [ |
| 55 | "libflatbuffers-cpp", |
| 56 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 57 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 58 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 59 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 60 | "BluetoothGeneratedPackets_h", |
| 61 | ], |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 62 | header_libs: ["libbt_callbacks_cxx_headers"], |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 63 | host_supported: true, |
| 64 | } |
| 65 | |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 66 | cc_library_shared { |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 67 | name: "libbluetooth", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 68 | defaults: ["fluoride_defaults"], |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 69 | header_libs: ["libbluetooth_headers"], |
| 70 | export_header_lib_headers: ["libbluetooth_headers"], |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 71 | include_dirs: [ |
| 72 | "packages/modules/Bluetooth/system", |
| 73 | "packages/modules/Bluetooth/system/bta/include", |
| 74 | "packages/modules/Bluetooth/system/bta/sys", |
| 75 | "packages/modules/Bluetooth/system/bta/dm", |
| 76 | "packages/modules/Bluetooth/system/btcore/include", |
Jakub Pawlowski | 9e9eb4b | 2017-10-17 16:40:41 -0700 | [diff] [blame] | 77 | "packages/modules/Bluetooth/system/internal_include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 78 | "packages/modules/Bluetooth/system/stack/include", |
| 79 | "packages/modules/Bluetooth/system/stack/l2cap", |
| 80 | "packages/modules/Bluetooth/system/stack/a2dp", |
| 81 | "packages/modules/Bluetooth/system/stack/btm", |
| 82 | "packages/modules/Bluetooth/system/stack/avdt", |
| 83 | "packages/modules/Bluetooth/system/udrv/include", |
| 84 | "packages/modules/Bluetooth/system/btif/include", |
| 85 | "packages/modules/Bluetooth/system/btif/co", |
| 86 | "packages/modules/Bluetooth/system/hci/include", |
| 87 | "packages/modules/Bluetooth/system/vnd/include", |
| 88 | "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include", |
| 89 | "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 90 | "packages/modules/Bluetooth/system/utils/include", |
Martin Brabham | f1e5738 | 2019-02-01 13:42:58 -0800 | [diff] [blame] | 91 | "system/security/keystore/include", |
| 92 | "hardware/interfaces/keymaster/4.0/support/include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 93 | ], |
| 94 | logtags: ["../../EventLogTags.logtags"], |
| 95 | shared_libs: [ |
Michael Sun | 0e67533 | 2020-11-06 01:19:16 +0000 | [diff] [blame] | 96 | "libcrypto", |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 97 | "libflatbuffers-cpp", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 98 | "liblog", |
Suren Baghdasaryan | 270fee6 | 2018-12-19 17:36:37 -0800 | [diff] [blame] | 99 | "libprocessgroup", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 100 | "libprotobuf-cpp-lite", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 101 | "libtinyxml2", |
Michael Sun | 0e67533 | 2020-11-06 01:19:16 +0000 | [diff] [blame] | 102 | "libutils", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 103 | ], |
| 104 | static_libs: [ |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 105 | "libbte", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 106 | "libbt-sbc-decoder", |
| 107 | "libbt-sbc-encoder", |
Pavlin Radoslavov | 262b15d | 2017-01-03 16:53:18 -0800 | [diff] [blame] | 108 | "libFraunhoferAAC", |
Jakub Pawlowski | f9a0e63 | 2017-11-24 15:19:54 -0800 | [diff] [blame] | 109 | "libg722codec", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 110 | "libudrv-uipc", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 111 | "libbluetooth_gd", // Gabeldorsche |
Zach Johnson | a5a0402 | 2020-12-09 00:39:55 +0000 | [diff] [blame] | 112 | "libbluetooth_rust_interop", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 113 | ], |
| 114 | whole_static_libs: [ |
| 115 | "libbt-bta", |
Jack He | 63d2fa3 | 2018-07-25 21:43:01 -0700 | [diff] [blame] | 116 | "libbt-common", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 117 | "libbtdevice", |
| 118 | "libbtif", |
| 119 | "libbt-hci", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 120 | "libbt-stack", |
| 121 | "libbt-utils", |
| 122 | "libbtcore", |
| 123 | "libosi", |
Jack He | 9a30a9f | 2018-03-03 00:03:25 -0800 | [diff] [blame] | 124 | "libbt-protos-lite", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 125 | ], |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 126 | target: { |
| 127 | android: { |
| 128 | shared_libs: [ |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame^] | 129 | "android.hardware.bluetooth.a2dp@1.0", |
| 130 | "android.hardware.bluetooth.audio@2.0", |
| 131 | "android.hardware.bluetooth.audio@2.1", |
| 132 | "android.hardware.bluetooth@1.0", |
| 133 | "android.hardware.bluetooth@1.1", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 134 | "android.system.suspend.control-V1-ndk", |
Jiyong Park | f83675d | 2021-07-27 12:18:38 +0900 | [diff] [blame] | 135 | "android.system.suspend-V1-ndk", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 136 | "libaaudio", |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame^] | 137 | "libbinder_ndk", |
| 138 | "libcutils", |
| 139 | "libhidlbase", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 140 | "libfmq", |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame^] | 141 | "libz", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 142 | ], |
| 143 | required: [ |
| 144 | "libldacBT_enc", |
| 145 | "libldacBT_abr", |
| 146 | ], |
| 147 | }, |
| 148 | }, |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 149 | // Shared library link options. |
| 150 | // References to global symbols and functions should bind to the library |
| 151 | // itself. This is to avoid issues with some of the unit/system tests |
| 152 | // that might link statically with some of the code in the library, and |
| 153 | // also dlopen(3) the shared library. |
| 154 | ldflags: ["-Wl,-Bsymbolic,-Bsymbolic-functions"], |
| 155 | required: [ |
| 156 | "bt_did.conf", |
| 157 | "bt_stack.conf", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 158 | ], |
| 159 | cflags: [ |
| 160 | "-DBUILDCFG", |
| 161 | ], |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 162 | sanitize: { |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 163 | never: true, |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 164 | }, |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 165 | host_supported: true, |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 166 | } |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 167 | |
| 168 | cc_library_static { |
| 169 | name: "libbluetooth-for-tests", |
| 170 | defaults: ["fluoride_defaults"], |
| 171 | |
| 172 | srcs: [ |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 173 | ":LibBluetoothSources", |
Chris Manton | 011f6a7 | 2019-12-15 13:20:13 -0800 | [diff] [blame] | 174 | ":LibBluetoothShimSources", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 175 | ], |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 176 | host_supported: true, |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 177 | include_dirs: [ |
| 178 | "packages/modules/Bluetooth/system", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 179 | "packages/modules/Bluetooth/system/gd", |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 180 | "packages/modules/Bluetooth/system/gd/rust/shim", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 181 | "packages/modules/Bluetooth/system/bta/include", |
| 182 | "packages/modules/Bluetooth/system/btcore/include", |
| 183 | "packages/modules/Bluetooth/system/btif/include", |
| 184 | "packages/modules/Bluetooth/system/hci/include", |
| 185 | "packages/modules/Bluetooth/system/internal_include", |
| 186 | "packages/modules/Bluetooth/system/stack/include", |
| 187 | "packages/modules/Bluetooth/system/utils/include", |
| 188 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 189 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 190 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 191 | "BluetoothGeneratedPackets_h", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 192 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 193 | ], |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 194 | cflags: [ |
| 195 | "-DBUILDCFG", |
| 196 | ], |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 197 | shared_libs: [ |
| 198 | "libflatbuffers-cpp", |
| 199 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 200 | whole_static_libs: [ |
| 201 | "libbluetooth_gd", // Gabeldorsche |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 202 | ], |
| 203 | } |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 204 | |
| 205 | cc_test { |
| 206 | name: "net_test_main_shim", |
| 207 | test_suites: ["device-tests"], |
| 208 | host_supported: true, |
| 209 | test_options: { |
| 210 | unit_test: true, |
| 211 | }, |
| 212 | defaults: ["fluoride_defaults"], |
| 213 | include_dirs: [ |
| 214 | "packages/modules/Bluetooth/system", |
| 215 | "packages/modules/Bluetooth/system/gd", |
| 216 | "packages/modules/Bluetooth/system/stack/include", |
| 217 | ], |
| 218 | srcs: [ |
Chris Manton | 847dc38 | 2021-05-12 10:08:48 -0700 | [diff] [blame] | 219 | ":TestCommonMainHandler", |
Chris Manton | 47ee7b3 | 2021-04-26 17:12:53 -0700 | [diff] [blame] | 220 | ":TestMockBta", |
| 221 | ":TestMockBtif", |
| 222 | ":TestMockLegacyHciCommands", |
| 223 | ":TestMockMainShimEntry", |
| 224 | ":TestMockStack", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 225 | "shim/acl_api.cc", |
| 226 | "shim/acl.cc", |
| 227 | "shim/acl_legacy_interface.cc", |
| 228 | "shim/btm_api.cc", |
| 229 | "shim/btm.cc", |
| 230 | "shim/config.cc", |
| 231 | "shim/controller.cc", |
| 232 | "shim/dumpsys.cc", |
| 233 | "shim/hci_layer.cc", |
| 234 | "shim/l2c_api.cc", |
| 235 | "shim/le_advertising_manager.cc", |
| 236 | "shim/le_scanning_manager.cc", |
| 237 | "shim/link_policy.cc", |
Chen Chen | 534bf24 | 2021-03-10 15:41:42 -0800 | [diff] [blame] | 238 | "shim/metric_id_api.cc", |
| 239 | "shim/metrics_api.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 240 | "shim/shim.cc", |
| 241 | "shim/stack.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 242 | "test/main_shim_test.cc", |
| 243 | ], |
| 244 | static_libs: [ |
| 245 | "libbt-common", |
| 246 | "libbt-protos-lite", |
| 247 | "libgmock", |
| 248 | "liblog", |
| 249 | "libosi", |
| 250 | "libbtdevice", |
| 251 | ], |
| 252 | shared_libs: [ |
| 253 | "libcrypto", |
| 254 | "libflatbuffers-cpp", |
| 255 | "libprotobuf-cpp-lite", |
| 256 | ], |
| 257 | sanitize: { |
| 258 | address: true, |
| 259 | all_undefined: true, |
| 260 | cfi: true, |
| 261 | integer_overflow: true, |
| 262 | scs: true, |
| 263 | diag: { |
| 264 | undefined : true |
| 265 | }, |
| 266 | }, |
| 267 | generated_headers: [ |
| 268 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
| 269 | "BluetoothGeneratedDumpsysDataSchema_h", |
| 270 | "BluetoothGeneratedDumpsysBundledSchema_h", |
| 271 | "BluetoothGeneratedPackets_h", |
| 272 | ], |
| 273 | } |