• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2#  Copyright 2015 Google, Inc.
3#
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
17# Nonstandard codecs are associated with 3P libs and must be contained in MMC
18source_set("nonstandard_codecs") {
19  if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
20    sources = [
21      "a2dp/a2dp_aac.cc",
22      "a2dp/a2dp_aac_decoder_linux.cc",
23      "a2dp/a2dp_aac_encoder_linux.cc",
24      "a2dp/a2dp_vendor.cc",
25      # Following are unimplemented
26      "a2dp/a2dp_vendor_aptx_linux.cc",
27      "a2dp/a2dp_vendor_aptx_hd_linux.cc",
28      "a2dp/a2dp_vendor_ldac_linux.cc",
29      "a2dp/a2dp_vendor_opus_linux.cc",
30    ]
31
32    include_dirs = [
33      "//bt/system",
34      "//bt/system/bta/include",
35      "//bt/system/btif/include",
36      "//bt/system/include",
37      "//bt/system/stack",
38      "//bt/system/stack/include",
39      "//bt/system/utils/include",
40    ]
41
42    deps = [
43      "//bt/system/gd/rust/shim:init_flags_bridge_header",
44      "//bt/system/stack/mmc",
45    ]
46
47    configs += [
48      "//bt/system:target_defaults",
49      "//bt/system/log:log_defaults",
50    ]
51  }
52}
53
54source_set("stack") {
55  sources = [
56    "a2dp/a2dp_api.cc",
57    "a2dp/a2dp_codec_config.cc",
58    "a2dp/a2dp_ext.cc",
59    "a2dp/a2dp_sbc.cc",
60    "a2dp/a2dp_sbc_decoder.cc",
61    "a2dp/a2dp_sbc_encoder.cc",
62    "a2dp/a2dp_sbc_up_sample.cc",
63    "acl/acl.cc",
64    "acl/ble_acl.cc",
65    "acl/btm_acl.cc",
66    "acl/btm_pm.cc",
67    "arbiter/acl_arbiter.cc",
68    "avct/avct_api.cc",
69    "avct/avct_bcb_act.cc",
70    "avct/avct_ccb.cc",
71    "avct/avct_l2c.cc",
72    "avct/avct_l2c_br.cc",
73    "avct/avct_lcb.cc",
74    "avct/avct_lcb_act.cc",
75    "avdt/avdt_ad.cc",
76    "avdt/avdt_api.cc",
77    "avdt/avdt_ccb.cc",
78    "avdt/avdt_ccb_act.cc",
79    "avdt/avdt_l2c.cc",
80    "avdt/avdt_msg.cc",
81    "avdt/avdt_scb.cc",
82    "avdt/avdt_scb_act.cc",
83    "avrc/avrc_api.cc",
84    "avrc/avrc_bld_ct.cc",
85    "avrc/avrc_bld_tg.cc",
86    "avrc/avrc_opt.cc",
87    "avrc/avrc_pars_ct.cc",
88    "avrc/avrc_pars_tg.cc",
89    "avrc/avrc_sdp.cc",
90    "avrc/avrc_utils.cc",
91    "bnep/bnep_api.cc",
92    "bnep/bnep_main.cc",
93    "bnep/bnep_utils.cc",
94    "btm/ble_scanner_hci_interface.cc",
95    "btm/btm_ble.cc",
96    "btm/btm_ble_addr.cc",
97    "btm/btm_ble_adv_filter.cc",
98    "btm/btm_ble_bgconn.cc",
99    "btm/btm_ble_cont_energy.cc",
100    "btm/btm_ble_gap.cc",
101    "btm/btm_ble_privacy.cc",
102    "btm/btm_ble_scanner.cc",
103    "btm/btm_ble_sec.cc",
104    "btm/btm_client_interface.cc",
105    "btm/btm_dev.cc",
106    "btm/btm_devctl.cc",
107    "btm/btm_inq.cc",
108    "btm/btm_iot_config.cc",
109    "btm/btm_iso.cc",
110    "btm/btm_main.cc",
111    "btm/btm_sco.cc",
112    "btm/btm_sco_hci.cc",
113    "btm/btm_sco_hfp_hal_linux.cc",
114    "btm/btm_sec.cc",
115    "btm/btm_sec_cb.cc",
116    "btm/btm_security_client_interface.cc",
117    "btm/security_event_parser.cc",
118    "btm/hfp_lc3_encoder_linux.cc",
119    "btm/hfp_lc3_decoder_linux.cc",
120    "btm/hfp_msbc_encoder.cc",
121    "btm/hfp_msbc_decoder.cc",
122    "btu/btu_event.cc",
123    "btu/btu_hcif.cc",
124    "btu/main_thread.cc",
125    "eatt/eatt.cc",
126    "gap/gap_ble.cc",
127    "gap/gap_conn.cc",
128    "gatt/att_protocol.cc",
129    "gatt/connection_manager.cc",
130    "gatt/gatt_api.cc",
131    "gatt/gatt_attr.cc",
132    "gatt/gatt_auth.cc",
133    "gatt/gatt_cl.cc",
134    "gatt/gatt_db.cc",
135    "gatt/gatt_main.cc",
136    "gatt/gatt_sr.cc",
137    "gatt/gatt_sr_hash.cc",
138    "gatt/gatt_utils.cc",
139    "hcic/hciblecmds.cc",
140    "hcic/hcicmds.cc",
141    "hid/hidd_api.cc",
142    "hid/hidd_conn.cc",
143    "hid/hidh_api.cc",
144    "hid/hidh_conn.cc",
145    "l2cap/l2c_api.cc",
146    "l2cap/l2c_ble.cc",
147    "l2cap/l2c_ble_conn_params.cc",
148    "l2cap/l2c_csm.cc",
149    "l2cap/l2c_fcr.cc",
150    "l2cap/l2c_link.cc",
151    "l2cap/l2c_main.cc",
152    "l2cap/l2c_utils.cc",
153    "metrics/stack_metrics_logging.cc",
154    "pan/pan_api.cc",
155    "pan/pan_main.cc",
156    "pan/pan_utils.cc",
157    "rfcomm/port_api.cc",
158    "rfcomm/port_rfc.cc",
159    "rfcomm/port_utils.cc",
160    "rfcomm/rfc_l2cap_if.cc",
161    "rfcomm/rfc_mx_fsm.cc",
162    "rfcomm/rfc_port_fsm.cc",
163    "rfcomm/rfc_port_if.cc",
164    "rfcomm/rfc_ts_frames.cc",
165    "rfcomm/rfc_utils.cc",
166    "sdp/sdp_api.cc",
167    "sdp/sdp_db.cc",
168    "sdp/sdp_discovery.cc",
169    "sdp/sdp_main.cc",
170    "sdp/sdp_server.cc",
171    "sdp/sdp_utils.cc",
172    "smp/p_256_curvepara.cc",
173    "smp/p_256_ecc_pp.cc",
174    "smp/p_256_multprecision.cc",
175    "smp/smp_act.cc",
176    "smp/smp_api.cc",
177    "smp/smp_br_main.cc",
178    "smp/smp_keys.cc",
179    "smp/smp_l2c.cc",
180    "smp/smp_main.cc",
181    "smp/smp_utils.cc",
182    "srvc/srvc_dis.cc",
183    "srvc/srvc_eng.cc",
184  ]
185
186  include_dirs = [
187    ".",
188    "include",
189    "avct",
190    "btm",
191    "avrc",
192    "l2cap",
193    "avdt",
194    "gatt",
195    "gap",
196    "pan",
197    "bnep",
198    "eatt",
199    "hid",
200    "metrics",
201    "sdp",
202    "smp",
203    "srvc",
204    "//bt/system/",
205    "//bt/system/bta/include",
206    "//bt/system/bta/sys",
207    "//bt/system/btif/include",
208    "//bt/system/ctrlr/include",
209    "//bt/system/gd",
210    "//bt/system/hcis",
211    "//bt/system/linux_include",
212    "//bt/system/rpc/include",
213    "//bt/system/types",
214    "//bt/system/udrv/include",
215    "//bt/system/vnd/ble",
216    "//bt/system/vnd/include",
217  ]
218
219  deps = [
220    "//bt/sysprop:libcom.android.sysprop.bluetooth",
221    "//bt/system/gd/crypto_toolbox:crypto_toolbox",
222    ":nonstandard_codecs",
223    "//bt/system:libbt-platform-protos-lite",
224    "//bt/system/gd/rust/shim:init_flags_bridge_header",
225    "//bt/system/stack/mmc",
226    "//bt/system/types",
227  ]
228
229  configs += [
230    "//bt/system:target_defaults",
231    "//bt/system/log:log_defaults",
232  ]
233}
234
235if (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_gatt_layer.cc",
241      "test/common/mock_hcic_layer.cc",
242    ]
243
244    include_dirs = [
245      "btm",
246      "include",
247      "test/common",
248      "//bt/system/packet/tests",
249    ]
250
251    deps = [
252      "//bt/system/common",
253      "//bt/system/osi",
254    ]
255
256    configs += [
257      "//bt/system:external_gmock_main",
258      "//bt/system:target_defaults",
259    ]
260  }
261}
262
263if (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",
272      "//bt/system/",
273      "//bt/system/bta/eatt",
274      "//bt/system/bta/include",
275      "//bt/system/bta/sys",
276      "//bt/system/embdrv/sbc/encoder/include",
277      "//bt/system/stack/a2dp",
278      "//bt/system/stack/btm",
279      "//bt/system/stack/include",
280      "//bt/system/udrv/include",
281      "//bt/system/vnd/include",
282    ]
283
284    libs = [
285      "dl",
286      "fmt",
287      "pthread",
288      "resolv",
289      "rt",
290      "z",
291    ]
292
293    deps = [
294      ":stack",
295      "//bt/system/btcore",
296      "//bt/system/device",
297      "//bt/system/embdrv/g722",
298      "//bt/system/embdrv/sbc",
299      "//bt/system/hci",
300      "//bt/system/main:bluetooth",
301      "//bt/system/osi",
302      "//bt/system/types",
303    ]
304
305    configs += [
306      "//bt/system:external_tinyxml2",
307      "//bt/system:external_gmock_main",
308      "//bt/system:target_defaults",
309    ]
310  }
311
312  executable("net_test_stack_smp") {
313    sources = [
314      "smp/p_256_curvepara.cc",
315      "smp/p_256_ecc_pp.cc",
316      "smp/p_256_multprecision.cc",
317      "smp/smp_api.cc",
318      "smp/smp_keys.cc",
319      "smp/smp_main.cc",
320      "smp/smp_utils.cc",
321      "test/stack_smp_test.cc",
322    ]
323
324    include_dirs = [
325      "//bt/system/",
326      "//bt/system/linux_include",
327      "//bt/system/bta/include",
328      "//bt/system/bta/sys",
329      "//bt/system/embdrv/sbc/encoder/include",
330      "//bt/system/stack/a2dp",
331      "//bt/system/stack/l2cap",
332      "//bt/system/stack/btm",
333      "//bt/system/stack/include",
334      "//bt/system/udrv/include",
335      "//bt/system/vnd/include",
336    ]
337
338    libs = [
339      "dl",
340      "fmt",
341      "pthread",
342      "resolv",
343      "rt",
344      "z",
345    ]
346
347    deps = [
348      "//bt/system/gd:crypto_toolbox",
349      "//bt/system/osi",
350      "//bt/system/types",
351    ]
352
353    configs += [
354      "//bt/system:external_tinyxml2",
355      "//bt/system:external_gmock_main",
356      "//bt/system:target_defaults",
357    ]
358  }
359}
360