blob: a0c1b6be410f50c00ca5e0780df5e6503eec8d40 [file] [log] [blame]
Arman Ugurayab77f132015-05-26 14:50:36 -07001#
Jakub Pawlowski3b10fdd2017-09-18 09:00:20 -07002# Copyright 2015 Google, Inc.
Arman Ugurayab77f132015-05-26 14:50:36 -07003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at:
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020017static_library("crypto_toolbox") {
18 sources = [
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020019 "crypto_toolbox/aes.cc",
20 "crypto_toolbox/aes_cmac.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000021 "crypto_toolbox/crypto_toolbox.cc",
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020022 ]
23
Sonny Sasaka116ae622021-02-03 19:14:56 +000024 include_dirs = [ "//bt/" ]
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020025
Sonny Sasaka116ae622021-02-03 19:14:56 +000026 configs += [ "//bt:target_defaults" ]
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020027}
28
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080029source_set("nonstandard_codecs") {
Sonny Sasaka116ae622021-02-03 19:14:56 +000030 if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
31 sources = [
32 "a2dp/a2dp_aac.cc",
33 "a2dp/a2dp_aac_decoder.cc",
34 "a2dp/a2dp_aac_encoder.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +000035 "a2dp/a2dp_vendor.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000036 "a2dp/a2dp_vendor_aptx.cc",
37 "a2dp/a2dp_vendor_aptx_encoder.cc",
38 "a2dp/a2dp_vendor_aptx_hd.cc",
39 "a2dp/a2dp_vendor_aptx_hd_encoder.cc",
40 "a2dp/a2dp_vendor_ldac.cc",
41 "a2dp/a2dp_vendor_ldac_abr.cc",
42 "a2dp/a2dp_vendor_ldac_decoder.cc",
43 "a2dp/a2dp_vendor_ldac_encoder.cc",
44 ]
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080045
Sonny Sasaka116ae622021-02-03 19:14:56 +000046 include_dirs = [
47 "//bt",
48 "//bt/bta/include",
49 "//bt/btif/include",
50 "//bt/internal_include",
51 "//bt/stack/include",
52 "//bt/utils/include",
53 ]
54
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +000055 deps = [ "//bt/gd/rust/shim:init_flags_bridge_header" ]
Sonny Sasaka116ae622021-02-03 19:14:56 +000056
57 configs += [
58 "//bt:target_defaults",
59 "//bt:external_libldac",
60 "//bt:external_aac",
61 ]
62 }
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080063}
64
Sonny Sasaka116ae622021-02-03 19:14:56 +000065source_set("stack") {
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080066 sources = [
67 "a2dp/a2dp_api.cc",
68 "a2dp/a2dp_codec_config.cc",
69 "a2dp/a2dp_sbc.cc",
70 "a2dp/a2dp_sbc_decoder.cc",
71 "a2dp/a2dp_sbc_encoder.cc",
72 "a2dp/a2dp_sbc_up_sample.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +000073 "acl/acl.cc",
74 "acl/ble_acl.cc",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080075 "acl/btm_acl.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000076 "acl/btm_ble_connection_establishment.cc",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080077 "acl/btm_pm.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -070078 "avct/avct_api.cc",
79 "avct/avct_bcb_act.cc",
80 "avct/avct_ccb.cc",
81 "avct/avct_l2c.cc",
82 "avct/avct_l2c_br.cc",
83 "avct/avct_lcb.cc",
84 "avct/avct_lcb_act.cc",
85 "avdt/avdt_ad.cc",
86 "avdt/avdt_api.cc",
87 "avdt/avdt_ccb.cc",
88 "avdt/avdt_ccb_act.cc",
89 "avdt/avdt_l2c.cc",
90 "avdt/avdt_msg.cc",
91 "avdt/avdt_scb.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000092 "avdt/avdt_scb_act.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -070093 "avrc/avrc_api.cc",
94 "avrc/avrc_bld_ct.cc",
95 "avrc/avrc_bld_tg.cc",
96 "avrc/avrc_opt.cc",
97 "avrc/avrc_pars_ct.cc",
98 "avrc/avrc_pars_tg.cc",
99 "avrc/avrc_sdp.cc",
100 "avrc/avrc_utils.cc",
101 "bnep/bnep_api.cc",
102 "bnep/bnep_main.cc",
103 "bnep/bnep_utils.cc",
Jakub Pawlowskia8cee4f2016-10-13 15:43:15 -0700104 "btm/ble_advertiser_hci_interface.cc",
Jakub Tyszkowski76992ce2020-04-30 12:42:01 +0200105 "btm/ble_scanner_hci_interface.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700106 "btm/btm_ble.cc",
107 "btm/btm_ble_addr.cc",
108 "btm/btm_ble_adv_filter.cc",
109 "btm/btm_ble_batchscan.cc",
Jakub Pawlowski202a1462016-05-25 17:10:56 -0700110 "btm/btm_ble_bgconn.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700111 "btm/btm_ble_cont_energy.cc",
112 "btm/btm_ble_gap.cc",
Jakub Pawlowskic09e8aa2016-09-05 04:31:34 -0700113 "btm/btm_ble_multi_adv.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700114 "btm/btm_ble_privacy.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +0000115 "btm/btm_client_interface.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700116 "btm/btm_dev.cc",
117 "btm/btm_devctl.cc",
118 "btm/btm_inq.cc",
Jakub Tyszkowskid093be02020-08-20 10:58:19 +0000119 "btm/btm_iso.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700120 "btm/btm_main.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +0000121 "btm/btm_scn.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700122 "btm/btm_sco.cc",
Hansong Zhangbc82d592021-09-14 15:40:37 -0700123 "btm/btm_sco_hci.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700124 "btm/btm_sec.cc",
125 "btu/btu_hcif.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700126 "btu/btu_task.cc",
Łukasz Rymanowski3bde05c2020-05-09 01:26:11 +0200127 "eatt/eatt.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700128 "gap/gap_ble.cc",
129 "gap/gap_conn.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700130 "gatt/att_protocol.cc",
Jakub Pawlowski22d721e2018-11-09 11:53:11 +0100131 "gatt/connection_manager.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700132 "gatt/gatt_api.cc",
133 "gatt/gatt_attr.cc",
134 "gatt/gatt_auth.cc",
135 "gatt/gatt_cl.cc",
136 "gatt/gatt_db.cc",
137 "gatt/gatt_main.cc",
138 "gatt/gatt_sr.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +0000139 "gatt/gatt_sr_hash.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700140 "gatt/gatt_utils.cc",
141 "hcic/hciblecmds.cc",
142 "hcic/hcicmds.cc",
Hemant Gupta28425222014-04-18 12:34:55 +0530143 "hid/hidd_api.cc",
144 "hid/hidd_conn.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000145 "hid/hidh_api.cc",
146 "hid/hidh_conn.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700147 "l2cap/l2c_api.cc",
148 "l2cap/l2c_ble.cc",
149 "l2cap/l2c_csm.cc",
150 "l2cap/l2c_fcr.cc",
151 "l2cap/l2c_link.cc",
152 "l2cap/l2c_main.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700153 "l2cap/l2c_utils.cc",
Chen Chen534bf242021-03-10 15:41:42 -0800154 "metrics/stack_metrics_logging.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700155 "pan/pan_api.cc",
156 "pan/pan_main.cc",
157 "pan/pan_utils.cc",
158 "rfcomm/port_api.cc",
159 "rfcomm/port_rfc.cc",
160 "rfcomm/port_utils.cc",
161 "rfcomm/rfc_l2cap_if.cc",
162 "rfcomm/rfc_mx_fsm.cc",
163 "rfcomm/rfc_port_fsm.cc",
164 "rfcomm/rfc_port_if.cc",
165 "rfcomm/rfc_ts_frames.cc",
166 "rfcomm/rfc_utils.cc",
167 "sdp/sdp_api.cc",
168 "sdp/sdp_db.cc",
169 "sdp/sdp_discovery.cc",
170 "sdp/sdp_main.cc",
171 "sdp/sdp_server.cc",
172 "sdp/sdp_utils.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700173 "smp/p_256_curvepara.cc",
174 "smp/p_256_ecc_pp.cc",
175 "smp/p_256_multprecision.cc",
176 "smp/smp_act.cc",
177 "smp/smp_api.cc",
178 "smp/smp_br_main.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700179 "smp/smp_keys.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000180 "smp/smp_l2c.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700181 "smp/smp_main.cc",
182 "smp/smp_utils.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700183 "srvc/srvc_dis.cc",
184 "srvc/srvc_eng.cc",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700185 ]
186
187 include_dirs = [
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800188 ".",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700189 "include",
190 "avct",
191 "btm",
192 "avrc",
193 "l2cap",
194 "avdt",
195 "gatt",
196 "gap",
197 "pan",
198 "bnep",
Łukasz Rymanowski3bde05c2020-05-09 01:26:11 +0200199 "eatt",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700200 "hid",
Chen Chen534bf242021-03-10 15:41:42 -0800201 "metrics",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700202 "sdp",
203 "smp",
204 "srvc",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800205 "//bt/types",
206 "//bt/linux_include",
207 "//bt/internal_include",
208 "//bt/btcore/include",
209 "//bt/vnd/include",
210 "//bt/vnd/ble",
211 "//bt/btif/include",
212 "//bt/hci/include",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800213 "//bt/udrv/include",
214 "//bt/rpc/include",
215 "//bt/hcis",
216 "//bt/ctrlr/include",
217 "//bt/bta/include",
218 "//bt/bta/sys",
219 "//bt/utils/include",
220 "//bt/",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700221 ]
Jakub Pawlowskic287f082016-09-06 07:42:36 -0700222
223 deps = [
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +0200224 ":crypto_toolbox",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000225 ":nonstandard_codecs",
Abhishek Pandit-Subedi39c39612021-03-02 22:33:33 +0000226 "//bt:libbt-platform-protos-lite",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800227 "//bt/gd/rust/shim:init_flags_bridge_header",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800228 "//bt/types",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +0000229 "//bt/types",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800230 ]
231
Sonny Sasaka116ae622021-02-03 19:14:56 +0000232 configs += [ "//bt:target_defaults" ]
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +0200233}
234
Sonny Sasaka116ae622021-02-03 19:14:56 +0000235if (use.test) {
236 executable("net_test_btm_iso") {
237 sources = [
238 "btm/btm_iso.cc",
239 "test/btm_iso_test.cc",
240 "test/common/mock_controller.cc",
241 "test/common/mock_gatt_layer.cc",
242 "test/common/mock_hcic_layer.cc",
243 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700244
Sonny Sasaka116ae622021-02-03 19:14:56 +0000245 include_dirs = [
246 "btm",
247 "include",
248 "test/common",
249 "//bt/internal_include",
250 "//bt/packet/tests",
251 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700252
Sonny Sasaka116ae622021-02-03 19:14:56 +0000253 deps = [
Sonny Sasaka116ae622021-02-03 19:14:56 +0000254 "//bt/common",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +0000255 "//bt/osi",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000256 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700257
Sonny Sasaka116ae622021-02-03 19:14:56 +0000258 configs += [
259 "//bt:external_gmock_main",
260 "//bt:target_defaults",
261 ]
262 }
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700263}
264
Sonny Sasaka116ae622021-02-03 19:14:56 +0000265if (defined(use.android) && use.android) {
266 executable("stack_unittests") {
267 sources = [
268 "test/stack_a2dp_test.cc",
269 "test/stack_avrcp_test.cc",
270 ]
271
272 include_dirs = [
273 "include",
274 "//bt/",
275 "//bt/bta/eatt",
276 "//bt/bta/include",
277 "//bt/bta/sys",
278 "//bt/btcore/include",
279 "//bt/embdrv/sbc/encoder/include",
280 "//bt/hci/include",
281 "//bt/internal_include",
282 "//bt/stack/a2dp",
283 "//bt/stack/btm",
284 "//bt/stack/include",
285 "//bt/udrv/include",
286 "//bt/utils/include",
287 "//bt/vnd/include",
288 ]
289
290 libs = [
291 "dl",
292 "pthread",
293 "resolv",
294 "rt",
295 "z",
296 ]
297
298 deps = [
299 ":stack",
300 "//bt/btcore",
301 "//bt/device",
302 "//bt/embdrv/g722",
303 "//bt/embdrv/sbc",
304 "//bt/hci",
305 "//bt/main:bluetooth",
306 "//bt/osi",
307 "//bt/types",
308 ]
309
310 configs += [
311 "//bt:external_tinyxml2",
312 "//bt:external_gmock_main",
313 "//bt:target_defaults",
314 ]
315 }
316
317 executable("net_test_stack_crypto_toolbox") {
318 sources = [ "test/crypto_toolbox_test.cc" ]
319
320 include_dirs = [ "//bt/" ]
321
322 deps = [ ":crypto_toolbox" ]
323
324 configs += [
325 "//bt:external_gmock_main",
326 "//bt:target_defaults",
327 ]
328 }
329
330 executable("net_test_stack_smp") {
331 sources = [
332 "smp/p_256_curvepara.cc",
333 "smp/p_256_ecc_pp.cc",
334 "smp/p_256_multprecision.cc",
335 "smp/smp_api.cc",
336 "smp/smp_keys.cc",
337 "smp/smp_main.cc",
338 "smp/smp_utils.cc",
339 "test/stack_smp_test.cc",
340 ]
341
342 include_dirs = [
343 "//bt/",
344 "//bt/linux_include",
345 "//bt/internal_include",
346 "//bt/btcore/include",
347 "//bt/hci/include",
348 "//bt/utils/include",
349 "//bt/bta/include",
350 "//bt/bta/sys",
351 "//bt/btcore/include",
352 "//bt/embdrv/sbc/encoder/include",
353 "//bt/hci/include",
354 "//bt/internal_include",
355 "//bt/stack/a2dp",
356 "//bt/stack/l2cap",
357 "//bt/stack/btm",
358 "//bt/stack/include",
359 "//bt/udrv/include",
360 "//bt/utils/include",
361 "//bt/vnd/include",
362 ]
363
364 libs = [
365 "dl",
366 "pthread",
367 "resolv",
368 "rt",
369 "z",
370 ]
371
372 deps = [
373 ":crypto_toolbox",
374 "//bt/osi",
375 "//bt/types",
376 ]
377
378 configs += [
379 "//bt:external_tinyxml2",
380 "//bt:external_gmock_main",
381 "//bt:target_defaults",
382 ]
383 }
384
385 executable("net_test_stack_multi_adv") {
386 sources = [
387 "btm/btm_ble_multi_adv.cc",
388 "test/ble_advertiser_test.cc",
389 ]
390
391 include_dirs = [
392 "include",
393 "//bt/",
394 "//bt/btcore/include",
395 "//bt/hci/include",
396 "//bt/internal_include",
397 "//bt/stack/btm",
398 ]
399
400 libs = [
401 "dl",
402 "pthread",
403 "resolv",
404 "rt",
405 "z",
406 ]
407
408 deps = [ "//bt/types" ]
409
410 configs += [
411 "//bt:external_gmock_main",
412 "//bt:target_defaults",
413 ]
414 }
415}