• 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/stack/mmc",
44    ]
45
46    configs += [
47      "//bt/system:target_defaults",
48      "//bt/system/log:log_defaults",
49    ]
50  }
51}
52
53source_set("stack") {
54  sources = [
55    "ais/ais_ble.cc",
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_cont_energy.cc",
99    "btm/btm_ble_gap.cc",
100    "btm/btm_ble_privacy.cc",
101    "btm/btm_ble_scanner.cc",
102    "btm/btm_ble_sec.cc",
103    "btm/btm_client_interface.cc",
104    "btm/btm_dev.cc",
105    "btm/btm_devctl.cc",
106    "btm/btm_inq.cc",
107    "btm/btm_iot_config.cc",
108    "btm/btm_iso.cc",
109    "btm/btm_main.cc",
110    "btm/btm_sco.cc",
111    "btm/btm_sco_hci.cc",
112    "btm/btm_sco_hfp_hal_linux.cc",
113    "btm/btm_sec.cc",
114    "btm/btm_sec_cb.cc",
115    "btm/btm_security_client_interface.cc",
116    "btm/security_event_parser.cc",
117    "btm/hfp_lc3_encoder_linux.cc",
118    "btm/hfp_lc3_decoder_linux.cc",
119    "btm/hfp_msbc_encoder.cc",
120    "btm/hfp_msbc_decoder.cc",
121    "btu/btu_hcif.cc",
122    "btu/main_thread.cc",
123    "eatt/eatt.cc",
124    "gap/gap_ble.cc",
125    "gap/gap_conn.cc",
126    "gatt/att_protocol.cc",
127    "connection_manager/connection_manager.cc",
128    "gatt/gatt_api.cc",
129    "gatt/gatt_attr.cc",
130    "gatt/gatt_auth.cc",
131    "gatt/gatt_cl.cc",
132    "gatt/gatt_db.cc",
133    "gatt/gatt_main.cc",
134    "gatt/gatt_sr.cc",
135    "gatt/gatt_sr_hash.cc",
136    "gatt/gatt_utils.cc",
137    "hcic/hciblecmds.cc",
138    "hcic/hcicmds.cc",
139    "hid/hidd_api.cc",
140    "hid/hidd_conn.cc",
141    "hid/hidh_api.cc",
142    "hid/hidh_conn.cc",
143    "l2cap/l2c_api.cc",
144    "l2cap/l2c_ble.cc",
145    "l2cap/l2c_ble_conn_params.cc",
146    "l2cap/l2c_csm.cc",
147    "l2cap/l2c_fcr.cc",
148    "l2cap/l2c_link.cc",
149    "l2cap/l2c_main.cc",
150    "l2cap/l2c_utils.cc",
151    "l2cap/l2cap_api.cc",
152    "pan/pan_api.cc",
153    "pan/pan_main.cc",
154    "pan/pan_utils.cc",
155    "rfcomm/port_api.cc",
156    "rfcomm/port_rfc.cc",
157    "rfcomm/port_utils.cc",
158    "rfcomm/rfc_l2cap_if.cc",
159    "rfcomm/rfc_metrics.cc",
160    "rfcomm/rfc_mx_fsm.cc",
161    "rfcomm/rfc_port_fsm.cc",
162    "rfcomm/rfc_port_if.cc",
163    "rfcomm/rfc_ts_frames.cc",
164    "rfcomm/rfc_utils.cc",
165    "rnr/remote_name_request.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    "ais",
190    "avct",
191    "btm",
192    "avrc",
193    "l2cap",
194    "avdt",
195    "gatt",
196    "gap",
197    "pan",
198    "bnep",
199    "eatt",
200    "hid",
201    "metrics",
202    "sdp",
203    "smp",
204    "srvc",
205    "//bt/system/",
206    "//bt/system/bta/include",
207    "//bt/system/bta/sys",
208    "//bt/system/btif/include",
209    "//bt/system/ctrlr/include",
210    "//bt/system/gd",
211    "//bt/system/hcis",
212    "//bt/system/rpc/include",
213    "//bt/system/udrv/include",
214    "//bt/system/vnd/ble",
215    "//bt/system/vnd/include",
216  ]
217
218  deps = [
219    "//bt/sysprop:libcom.android.sysprop.bluetooth",
220    "//bt/system/gd/crypto_toolbox:crypto_toolbox",
221    "//bt/system/gd/rust/topshim:cxxlibheader",
222    ":nonstandard_codecs",
223    "//bt/system:libbt-platform-protos-lite",
224    "//bt/system/stack/mmc",
225    "//bt/system/types",
226  ]
227  if (use.test) {
228    deps += [
229      ":sco_hci_linux_test",
230    ]
231  }
232
233  configs += [
234    "//bt/system:target_defaults",
235    "//bt/system/log:log_defaults",
236  ]
237}
238
239if (use.test) {
240  executable("sco_hci_linux_test") {
241    sources = [
242      "btm/btm_sco_hci.cc",
243      "test/btm/sco_hci_linux_test.cc",
244      "//bt/system/test/common/core_interface.cc",
245      "//bt/system/test/common/mock_functions.cc",
246      "//bt/system/test/fake/fake_osi.cc",
247      "//bt/system/test/mock/mock_bluetooth_interface.cc",
248      "//bt/system/test/mock/mock_btif_stack_manager.cc",
249      "//bt/system/test/mock/mock_osi_alarm.cc",
250      "//bt/system/test/mock/mock_osi_allocator.cc",
251      "//bt/system/test/mock/mock_osi_fixed_queue.cc",
252      "//bt/system/test/mock/mock_osi_list.cc",
253      "//bt/system/test/mock/mock_stack_rnr_interface.cc",
254      "//bt/system/test/mock/mock_udrv_ulinux_uipc.cc",
255    ]
256
257    include_dirs = [
258      "btm",
259      "include",
260      "test/common",
261    ]
262    libs = [
263      "fmt",
264    ]
265    deps = [
266      "//bt/system/log:libbluetooth_log",
267      "//bt/system/common",
268      "//bt/system/osi",
269      "//bt/system/types",
270    ]
271    configs += [
272      "//bt/system:external_gmock_main",
273      "//bt/system:target_defaults",
274      "//bt/system/log:log_defaults",
275    ]
276  }
277
278  executable("net_test_btm_iso") {
279    sources = [
280      "btm/btm_iso.cc",
281      "test/btm_iso_test.cc",
282      "test/common/mock_gatt_layer.cc",
283      "test/common/mock_hcic_layer.cc",
284    ]
285
286    include_dirs = [
287      "btm",
288      "include",
289      "test/common",
290      "//bt/system/packet/tests",
291    ]
292
293    deps = [
294      "//bt/system/common",
295      "//bt/system/osi",
296    ]
297
298    configs += [
299      "//bt/system:external_gmock_main",
300      "//bt/system:target_defaults",
301    ]
302  }
303}
304
305if (defined(use.android) && use.android) {
306  executable("stack_unittests") {
307    sources = [
308      "test/stack_a2dp_test.cc",
309      "test/stack_avrcp_test.cc",
310    ]
311
312    include_dirs = [
313      "include",
314      "//bt/system/",
315      "//bt/system/bta/eatt",
316      "//bt/system/bta/include",
317      "//bt/system/bta/sys",
318      "//bt/system/embdrv/sbc/encoder/include",
319      "//bt/system/stack/a2dp",
320      "//bt/system/stack/btm",
321      "//bt/system/stack/include",
322      "//bt/system/udrv/include",
323      "//bt/system/vnd/include",
324    ]
325
326    libs = [
327      "dl",
328      "fmt",
329      "pthread",
330      "resolv",
331      "rt",
332      "z",
333    ]
334
335    deps = [
336      ":stack",
337      "//bt/system/btcore",
338      "//bt/system/device",
339      "//bt/system/embdrv/g722",
340      "//bt/system/embdrv/sbc",
341      "//bt/system/hci",
342      "//bt/system/main:bluetooth",
343      "//bt/system/osi",
344      "//bt/system/types",
345    ]
346
347    configs += [
348      "//bt/system:external_tinyxml2",
349      "//bt/system:external_gmock_main",
350      "//bt/system:target_defaults",
351    ]
352  }
353
354  executable("net_test_stack_smp") {
355    sources = [
356      "smp/p_256_curvepara.cc",
357      "smp/p_256_ecc_pp.cc",
358      "smp/p_256_multprecision.cc",
359      "smp/smp_api.cc",
360      "smp/smp_keys.cc",
361      "smp/smp_main.cc",
362      "smp/smp_utils.cc",
363      "test/stack_smp_test.cc",
364    ]
365
366    include_dirs = [
367      "//bt/system/",
368      "//bt/system/bta/include",
369      "//bt/system/bta/sys",
370      "//bt/system/embdrv/sbc/encoder/include",
371      "//bt/system/stack/a2dp",
372      "//bt/system/stack/l2cap",
373      "//bt/system/stack/btm",
374      "//bt/system/stack/include",
375      "//bt/system/udrv/include",
376      "//bt/system/vnd/include",
377    ]
378
379    libs = [
380      "dl",
381      "fmt",
382      "pthread",
383      "resolv",
384      "rt",
385      "z",
386    ]
387
388    deps = [
389      "//bt/system/gd:crypto_toolbox",
390      "//bt/system/osi",
391      "//bt/system/types",
392    ]
393
394    configs += [
395      "//bt/system:external_tinyxml2",
396      "//bt/system:external_gmock_main",
397      "//bt/system:target_defaults",
398    ]
399  }
400}
401