blob: 789533bcbd2271b724dcc3dde4e60380f0366e7e [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
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -080024 include_dirs = [ "//bt/system/" ]
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +020025
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -080026 configs += [ "//bt/system: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",
Sonny Sasaka116ae622021-02-03 19:14:56 +000041 "a2dp/a2dp_vendor_ldac_decoder.cc",
42 "a2dp/a2dp_vendor_ldac_encoder.cc",
43 ]
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080044
Sonny Sasaka116ae622021-02-03 19:14:56 +000045 include_dirs = [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -080046 "//bt/system",
47 "//bt/system/bta/include",
48 "//bt/system/btif/include",
49 "//bt/system/internal_include",
50 "//bt/system/stack/include",
51 "//bt/system/utils/include",
Sonny Sasaka116ae622021-02-03 19:14:56 +000052 ]
53
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -080054 deps = [ "//bt/system/gd/rust/shim:init_flags_bridge_header" ]
Sonny Sasaka116ae622021-02-03 19:14:56 +000055
56 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -080057 "//bt/system:target_defaults",
58 "//bt/system:external_libldac",
59 "//bt/system:external_aac",
Sonny Sasaka116ae622021-02-03 19:14:56 +000060 ]
61 }
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080062}
63
Sonny Sasaka116ae622021-02-03 19:14:56 +000064source_set("stack") {
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080065 sources = [
66 "a2dp/a2dp_api.cc",
67 "a2dp/a2dp_codec_config.cc",
68 "a2dp/a2dp_sbc.cc",
69 "a2dp/a2dp_sbc_decoder.cc",
70 "a2dp/a2dp_sbc_encoder.cc",
71 "a2dp/a2dp_sbc_up_sample.cc",
Abhishek Pandit-Subedi9bd82422021-03-02 22:33:10 +000072 "acl/acl.cc",
73 "acl/ble_acl.cc",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080074 "acl/btm_acl.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000075 "acl/btm_ble_connection_establishment.cc",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -080076 "acl/btm_pm.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -070077 "avct/avct_api.cc",
78 "avct/avct_bcb_act.cc",
79 "avct/avct_ccb.cc",
80 "avct/avct_l2c.cc",
81 "avct/avct_l2c_br.cc",
82 "avct/avct_lcb.cc",
83 "avct/avct_lcb_act.cc",
84 "avdt/avdt_ad.cc",
85 "avdt/avdt_api.cc",
86 "avdt/avdt_ccb.cc",
87 "avdt/avdt_ccb_act.cc",
88 "avdt/avdt_l2c.cc",
89 "avdt/avdt_msg.cc",
90 "avdt/avdt_scb.cc",
Sonny Sasaka116ae622021-02-03 19:14:56 +000091 "avdt/avdt_scb_act.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -070092 "avrc/avrc_api.cc",
93 "avrc/avrc_bld_ct.cc",
94 "avrc/avrc_bld_tg.cc",
95 "avrc/avrc_opt.cc",
96 "avrc/avrc_pars_ct.cc",
97 "avrc/avrc_pars_tg.cc",
98 "avrc/avrc_sdp.cc",
99 "avrc/avrc_utils.cc",
100 "bnep/bnep_api.cc",
101 "bnep/bnep_main.cc",
102 "bnep/bnep_utils.cc",
Jakub Pawlowskia8cee4f2016-10-13 15:43:15 -0700103 "btm/ble_advertiser_hci_interface.cc",
Jakub Tyszkowski76992ce2020-04-30 12:42:01 +0200104 "btm/ble_scanner_hci_interface.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700105 "btm/btm_ble.cc",
106 "btm/btm_ble_addr.cc",
107 "btm/btm_ble_adv_filter.cc",
108 "btm/btm_ble_batchscan.cc",
Jakub Pawlowski202a1462016-05-25 17:10:56 -0700109 "btm/btm_ble_bgconn.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700110 "btm/btm_ble_cont_energy.cc",
111 "btm/btm_ble_gap.cc",
Jakub Pawlowskic09e8aa2016-09-05 04:31:34 -0700112 "btm/btm_ble_multi_adv.cc",
Pavlin Radoslavov0c00b7d2016-10-14 19:34:48 -0700113 "btm/btm_ble_privacy.cc",
Abhishek Pandit-Subedi83a3fa82022-01-28 17:08:55 -0800114 "btm/btm_ble_scanner.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-Subedi947d4682021-11-12 15:52:11 -0800205 "//bt/system/types",
206 "//bt/system/linux_include",
207 "//bt/system/internal_include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800208 "//bt/system/vnd/include",
209 "//bt/system/vnd/ble",
210 "//bt/system/btif/include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800211 "//bt/system/udrv/include",
212 "//bt/system/rpc/include",
213 "//bt/system/hcis",
214 "//bt/system/ctrlr/include",
215 "//bt/system/bta/include",
216 "//bt/system/bta/sys",
217 "//bt/system/utils/include",
218 "//bt/system/",
Scott James Remnantdaef4752015-05-12 13:58:49 -0700219 ]
Jakub Pawlowskic287f082016-09-06 07:42:36 -0700220
221 deps = [
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +0200222 ":crypto_toolbox",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000223 ":nonstandard_codecs",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800224 "//bt/system:libbt-platform-protos-lite",
225 "//bt/system/gd/rust/shim:init_flags_bridge_header",
226 "//bt/system/types",
227 "//bt/system/types",
Abhishek Pandit-Subedic86d26f2021-01-08 19:53:23 -0800228 ]
229
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800230 configs += [ "//bt/system:target_defaults" ]
Jakub Pawlowskia5a4e272018-06-21 14:23:47 +0200231}
232
Sonny Sasaka116ae622021-02-03 19:14:56 +0000233if (use.test) {
234 executable("net_test_btm_iso") {
235 sources = [
236 "btm/btm_iso.cc",
237 "test/btm_iso_test.cc",
238 "test/common/mock_controller.cc",
239 "test/common/mock_gatt_layer.cc",
240 "test/common/mock_hcic_layer.cc",
241 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700242
Sonny Sasaka116ae622021-02-03 19:14:56 +0000243 include_dirs = [
244 "btm",
245 "include",
246 "test/common",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800247 "//bt/system/internal_include",
248 "//bt/system/packet/tests",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000249 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700250
Sonny Sasaka116ae622021-02-03 19:14:56 +0000251 deps = [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800252 "//bt/system/common",
253 "//bt/system/osi",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000254 ]
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700255
Sonny Sasaka116ae622021-02-03 19:14:56 +0000256 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800257 "//bt/system:external_gmock_main",
258 "//bt/system:target_defaults",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000259 ]
260 }
Jakub Pawlowskie4e2f642016-10-20 10:19:50 -0700261}
262
Sonny Sasaka116ae622021-02-03 19:14:56 +0000263if (defined(use.android) && use.android) {
264 executable("stack_unittests") {
265 sources = [
266 "test/stack_a2dp_test.cc",
267 "test/stack_avrcp_test.cc",
268 ]
269
270 include_dirs = [
271 "include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800272 "//bt/system/",
273 "//bt/system/bta/eatt",
274 "//bt/system/bta/include",
275 "//bt/system/bta/sys",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800276 "//bt/system/embdrv/sbc/encoder/include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800277 "//bt/system/internal_include",
278 "//bt/system/stack/a2dp",
279 "//bt/system/stack/btm",
280 "//bt/system/stack/include",
281 "//bt/system/udrv/include",
282 "//bt/system/utils/include",
283 "//bt/system/vnd/include",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000284 ]
285
286 libs = [
287 "dl",
288 "pthread",
289 "resolv",
290 "rt",
291 "z",
292 ]
293
294 deps = [
295 ":stack",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800296 "//bt/system/btcore",
297 "//bt/system/device",
298 "//bt/system/embdrv/g722",
299 "//bt/system/embdrv/sbc",
300 "//bt/system/hci",
301 "//bt/system/main:bluetooth",
302 "//bt/system/osi",
303 "//bt/system/types",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000304 ]
305
306 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800307 "//bt/system:external_tinyxml2",
308 "//bt/system:external_gmock_main",
309 "//bt/system:target_defaults",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000310 ]
311 }
312
313 executable("net_test_stack_crypto_toolbox") {
314 sources = [ "test/crypto_toolbox_test.cc" ]
315
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800316 include_dirs = [ "//bt/system/" ]
Sonny Sasaka116ae622021-02-03 19:14:56 +0000317
318 deps = [ ":crypto_toolbox" ]
319
320 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800321 "//bt/system:external_gmock_main",
322 "//bt/system:target_defaults",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000323 ]
324 }
325
326 executable("net_test_stack_smp") {
327 sources = [
328 "smp/p_256_curvepara.cc",
329 "smp/p_256_ecc_pp.cc",
330 "smp/p_256_multprecision.cc",
331 "smp/smp_api.cc",
332 "smp/smp_keys.cc",
333 "smp/smp_main.cc",
334 "smp/smp_utils.cc",
335 "test/stack_smp_test.cc",
336 ]
337
338 include_dirs = [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800339 "//bt/system/",
340 "//bt/system/linux_include",
341 "//bt/system/internal_include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800342 "//bt/system/utils/include",
343 "//bt/system/bta/include",
344 "//bt/system/bta/sys",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800345 "//bt/system/embdrv/sbc/encoder/include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800346 "//bt/system/internal_include",
347 "//bt/system/stack/a2dp",
348 "//bt/system/stack/l2cap",
349 "//bt/system/stack/btm",
350 "//bt/system/stack/include",
351 "//bt/system/udrv/include",
352 "//bt/system/utils/include",
353 "//bt/system/vnd/include",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000354 ]
355
356 libs = [
357 "dl",
358 "pthread",
359 "resolv",
360 "rt",
361 "z",
362 ]
363
364 deps = [
365 ":crypto_toolbox",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800366 "//bt/system/osi",
367 "//bt/system/types",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000368 ]
369
370 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800371 "//bt/system:external_tinyxml2",
372 "//bt/system:external_gmock_main",
373 "//bt/system:target_defaults",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000374 ]
375 }
376
377 executable("net_test_stack_multi_adv") {
378 sources = [
379 "btm/btm_ble_multi_adv.cc",
380 "test/ble_advertiser_test.cc",
381 ]
382
383 include_dirs = [
384 "include",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800385 "//bt/system/",
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800386 "//bt/system/internal_include",
387 "//bt/system/stack/btm",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000388 ]
389
390 libs = [
391 "dl",
392 "pthread",
393 "resolv",
394 "rt",
395 "z",
396 ]
397
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800398 deps = [ "//bt/system/types" ]
Sonny Sasaka116ae622021-02-03 19:14:56 +0000399
400 configs += [
Abhishek Pandit-Subedi947d4682021-11-12 15:52:11 -0800401 "//bt/system:external_gmock_main",
402 "//bt/system:target_defaults",
Sonny Sasaka116ae622021-02-03 19:14:56 +0000403 ]
404 }
405}