blob: e4d9c61c1ef2cc75b47500682b7593037f3c5c0c [file] [log] [blame]
Jack He65b2a572016-12-07 18:25:17 -08001// Bluetooth main HW module / shared library for target
Bob Badour92ecf7c2021-02-12 18:05:29 -08002package {
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 Manton28c4c582019-09-09 21:11:59 -070011filegroup {
12 name: "LibBluetoothSources",
13 srcs: [
14 "bte_conf.cc",
Chris Manton28c4c582019-09-09 21:11:59 -070015 "bte_init_cpp_logging.cc",
16 "bte_logmsg.cc",
17 "bte_main.cc",
Chris Manton28c4c582019-09-09 21:11:59 -070018 "stack_config.cc",
19 ]
20}
21
Chris Manton878cadc2020-01-07 14:05:36 -080022cc_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 Pawlowskid4e47052020-02-16 01:03:04 +010031 "packages/modules/Bluetooth/system/gd",
Zach Johnsond0204152020-12-02 13:45:19 -080032 "packages/modules/Bluetooth/system/gd/rust/shim",
Chris Manton878cadc2020-01-07 14:05:36 -080033 "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 Manton615296f2020-06-16 08:58:34 -070054 shared_libs: [
55 "libflatbuffers-cpp",
56 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010057 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -070058 "BluetoothGeneratedBundlerSchema_h_bfbs",
Chris Mantoned1c08b2020-06-26 22:17:14 -070059 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010060 "BluetoothGeneratedPackets_h",
61 ],
Zach Johnsond0204152020-12-02 13:45:19 -080062 header_libs: ["libbt_callbacks_cxx_headers"],
Chris Manton878cadc2020-01-07 14:05:36 -080063 host_supported: true,
64}
65
Jack He65b2a572016-12-07 18:25:17 -080066cc_library_shared {
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070067 name: "libbluetooth",
Jack He65b2a572016-12-07 18:25:17 -080068 defaults: ["fluoride_defaults"],
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070069 header_libs: ["libbluetooth_headers"],
70 export_header_lib_headers: ["libbluetooth_headers"],
Jack He65b2a572016-12-07 18:25:17 -080071 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 Pawlowski9e9eb4b2017-10-17 16:40:41 -070077 "packages/modules/Bluetooth/system/internal_include",
Jack He65b2a572016-12-07 18:25:17 -080078 "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 He65b2a572016-12-07 18:25:17 -080090 "packages/modules/Bluetooth/system/utils/include",
Martin Brabhamf1e57382019-02-01 13:42:58 -080091 "system/security/keystore/include",
92 "hardware/interfaces/keymaster/4.0/support/include",
Jack He65b2a572016-12-07 18:25:17 -080093 ],
94 logtags: ["../../EventLogTags.logtags"],
95 shared_libs: [
Michael Sun0e675332020-11-06 01:19:16 +000096 "libcrypto",
Chris Manton615296f2020-06-16 08:58:34 -070097 "libflatbuffers-cpp",
Jack He65b2a572016-12-07 18:25:17 -080098 "liblog",
Suren Baghdasaryan270fee62018-12-19 17:36:37 -080099 "libprocessgroup",
Jack He65b2a572016-12-07 18:25:17 -0800100 "libprotobuf-cpp-lite",
Jack He65b2a572016-12-07 18:25:17 -0800101 "libtinyxml2",
Michael Sun0e675332020-11-06 01:19:16 +0000102 "libutils",
Jack He65b2a572016-12-07 18:25:17 -0800103 ],
104 static_libs: [
Chris Manton878cadc2020-01-07 14:05:36 -0800105 "libbte",
Jack He65b2a572016-12-07 18:25:17 -0800106 "libbt-sbc-decoder",
107 "libbt-sbc-encoder",
Pavlin Radoslavov262b15d2017-01-03 16:53:18 -0800108 "libFraunhoferAAC",
Jakub Pawlowskif9a0e632017-11-24 15:19:54 -0800109 "libg722codec",
Jack He65b2a572016-12-07 18:25:17 -0800110 "libudrv-uipc",
Chris Manton28c4c582019-09-09 21:11:59 -0700111 "libbluetooth_gd", // Gabeldorsche
Zach Johnsona5a04022020-12-09 00:39:55 +0000112 "libbluetooth_rust_interop",
Jack He65b2a572016-12-07 18:25:17 -0800113 ],
114 whole_static_libs: [
115 "libbt-bta",
Jack He63d2fa32018-07-25 21:43:01 -0700116 "libbt-common",
Jack He65b2a572016-12-07 18:25:17 -0800117 "libbtdevice",
118 "libbtif",
119 "libbt-hci",
Jack He65b2a572016-12-07 18:25:17 -0800120 "libbt-stack",
121 "libbt-utils",
122 "libbtcore",
123 "libosi",
Jack He9a30a9f2018-03-03 00:03:25 -0800124 "libbt-protos-lite",
Jack He65b2a572016-12-07 18:25:17 -0800125 ],
Hansong Zhang0769e702021-03-01 17:52:04 -0800126 target: {
127 android: {
128 shared_libs: [
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700129 "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 Zhang0769e702021-03-01 17:52:04 -0800134 "android.system.suspend.control-V1-ndk",
Jiyong Parkf83675d2021-07-27 12:18:38 +0900135 "android.system.suspend-V1-ndk",
Hansong Zhang0769e702021-03-01 17:52:04 -0800136 "libaaudio",
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700137 "libbinder_ndk",
138 "libcutils",
139 "libhidlbase",
Hansong Zhang0769e702021-03-01 17:52:04 -0800140 "libfmq",
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700141 "libz",
Hansong Zhang0769e702021-03-01 17:52:04 -0800142 ],
143 required: [
144 "libldacBT_enc",
145 "libldacBT_abr",
146 ],
147 },
148 },
Jack He65b2a572016-12-07 18:25:17 -0800149 // 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 He65b2a572016-12-07 18:25:17 -0800158 ],
159 cflags: [
160 "-DBUILDCFG",
161 ],
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800162 sanitize: {
Hansong Zhang0769e702021-03-01 17:52:04 -0800163 never: true,
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800164 },
Hansong Zhang0769e702021-03-01 17:52:04 -0800165 host_supported: true,
Jack He65b2a572016-12-07 18:25:17 -0800166}
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700167
168cc_library_static {
169 name: "libbluetooth-for-tests",
170 defaults: ["fluoride_defaults"],
171
172 srcs: [
Chris Manton28c4c582019-09-09 21:11:59 -0700173 ":LibBluetoothSources",
Chris Manton011f6a72019-12-15 13:20:13 -0800174 ":LibBluetoothShimSources",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700175 ],
Chris Manton3ee967b2019-11-05 11:39:07 -0800176 host_supported: true,
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700177 include_dirs: [
178 "packages/modules/Bluetooth/system",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100179 "packages/modules/Bluetooth/system/gd",
Zach Johnsond0204152020-12-02 13:45:19 -0800180 "packages/modules/Bluetooth/system/gd/rust/shim",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700181 "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 Pawlowskid4e47052020-02-16 01:03:04 +0100189 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -0700190 "BluetoothGeneratedBundlerSchema_h_bfbs",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100191 "BluetoothGeneratedPackets_h",
Chris Mantoned1c08b2020-06-26 22:17:14 -0700192 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100193 ],
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700194 cflags: [
195 "-DBUILDCFG",
196 ],
Chris Manton615296f2020-06-16 08:58:34 -0700197 shared_libs: [
198 "libflatbuffers-cpp",
199 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100200 whole_static_libs: [
201 "libbluetooth_gd", // Gabeldorsche
Chris Manton3ee967b2019-11-05 11:39:07 -0800202 ],
203}
Chris Mantone6a57a22021-03-05 12:25:19 -0800204
205cc_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 Manton847dc382021-05-12 10:08:48 -0700219 ":TestCommonMainHandler",
Chris Manton47ee7b32021-04-26 17:12:53 -0700220 ":TestMockBta",
221 ":TestMockBtif",
222 ":TestMockLegacyHciCommands",
223 ":TestMockMainShimEntry",
224 ":TestMockStack",
Chris Mantone6a57a22021-03-05 12:25:19 -0800225 "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 Chen534bf242021-03-10 15:41:42 -0800238 "shim/metric_id_api.cc",
239 "shim/metrics_api.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800240 "shim/shim.cc",
241 "shim/stack.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800242 "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}