OSDN Git Service

DO NOT MERGE Fix OOB read before buffer length check
[android-x86/system-bt.git] / stack / BUILD.gn
1 #
2 #  Copyright (C) 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 static_library("stack") {
18   sources = [
19     "a2dp/a2dp_aac.cc",
20     "a2dp/a2dp_aac_encoder.cc",
21     "a2dp/a2dp_api.cc",
22     "a2dp/a2dp_codec_config.cc",
23     "a2dp/a2dp_sbc.cc",
24     "a2dp/a2dp_sbc_encoder.cc",
25     "a2dp/a2dp_sbc_up_sample.cc",
26     "a2dp/a2dp_vendor.cc",
27     "a2dp/a2dp_vendor_aptx.cc",
28     "a2dp/a2dp_vendor_aptx_encoder.cc",
29     "a2dp/a2dp_vendor_aptx_hd.cc",
30     "a2dp/a2dp_vendor_aptx_hd_encoder.cc",
31     "a2dp/a2dp_vendor_ldac.cc",
32     "a2dp/a2dp_vendor_ldac_abr.cc",
33     "a2dp/a2dp_vendor_ldac_encoder.cc",
34     "avct/avct_api.cc",
35     "avct/avct_bcb_act.cc",
36     "avct/avct_ccb.cc",
37     "avct/avct_l2c.cc",
38     "avct/avct_l2c_br.cc",
39     "avct/avct_lcb.cc",
40     "avct/avct_lcb_act.cc",
41     "avdt/avdt_ad.cc",
42     "avdt/avdt_api.cc",
43     "avdt/avdt_ccb.cc",
44     "avdt/avdt_ccb_act.cc",
45     "avdt/avdt_l2c.cc",
46     "avdt/avdt_msg.cc",
47     "avdt/avdt_scb.cc",
48     "avdt/avdt_scb_act.cc",
49     "avrc/avrc_api.cc",
50     "avrc/avrc_bld_ct.cc",
51     "avrc/avrc_bld_tg.cc",
52     "avrc/avrc_opt.cc",
53     "avrc/avrc_pars_ct.cc",
54     "avrc/avrc_pars_tg.cc",
55     "avrc/avrc_sdp.cc",
56     "avrc/avrc_utils.cc",
57     "bnep/bnep_api.cc",
58     "bnep/bnep_main.cc",
59     "bnep/bnep_utils.cc",
60     "btm/ble_advertiser_hci_interface.cc",
61     "btm/btm_acl.cc",
62     "btm/btm_ble.cc",
63     "btm/btm_ble_addr.cc",
64     "btm/btm_ble_adv_filter.cc",
65     "btm/btm_ble_batchscan.cc",
66     "btm/btm_ble_bgconn.cc",
67     "btm/btm_ble_cont_energy.cc",
68     "btm/btm_ble_gap.cc",
69     "btm/btm_ble_multi_adv.cc",
70     "btm/btm_ble_privacy.cc",
71     "btm/btm_dev.cc",
72     "btm/btm_devctl.cc",
73     "btm/btm_inq.cc",
74     "btm/btm_main.cc",
75     "btm/btm_pm.cc",
76     "btm/btm_sco.cc",
77     "btm/btm_sec.cc",
78     "btu/btu_hcif.cc",
79     "btu/btu_init.cc",
80     "btu/btu_task.cc",
81     "gap/gap_ble.cc",
82     "gap/gap_conn.cc",
83     "gatt/att_protocol.cc",
84     "gatt/gatt_api.cc",
85     "gatt/gatt_attr.cc",
86     "gatt/gatt_auth.cc",
87     "gatt/gatt_cl.cc",
88     "gatt/gatt_db.cc",
89     "gatt/gatt_main.cc",
90     "gatt/gatt_sr.cc",
91     "gatt/gatt_utils.cc",
92     "hcic/hciblecmds.cc",
93     "hcic/hcicmds.cc",
94     "hid/hidh_api.cc",
95     "hid/hidh_conn.cc",
96     "hid/hidd_api.cc",
97     "hid/hidd_conn.cc",
98     "l2cap/l2c_api.cc",
99     "l2cap/l2c_ble.cc",
100     "l2cap/l2c_csm.cc",
101     "l2cap/l2c_fcr.cc",
102     "l2cap/l2c_link.cc",
103     "l2cap/l2c_main.cc",
104     "l2cap/l2c_ucd.cc",
105     "l2cap/l2c_utils.cc",
106     "l2cap/l2cap_client.cc",
107     "mcap/mca_api.cc",
108     "mcap/mca_cact.cc",
109     "mcap/mca_csm.cc",
110     "mcap/mca_dact.cc",
111     "mcap/mca_dsm.cc",
112     "mcap/mca_l2c.cc",
113     "mcap/mca_main.cc",
114     "pan/pan_api.cc",
115     "pan/pan_main.cc",
116     "pan/pan_utils.cc",
117     "rfcomm/port_api.cc",
118     "rfcomm/port_rfc.cc",
119     "rfcomm/port_utils.cc",
120     "rfcomm/rfc_l2cap_if.cc",
121     "rfcomm/rfc_mx_fsm.cc",
122     "rfcomm/rfc_port_fsm.cc",
123     "rfcomm/rfc_port_if.cc",
124     "rfcomm/rfc_ts_frames.cc",
125     "rfcomm/rfc_utils.cc",
126     "sdp/sdp_api.cc",
127     "sdp/sdp_db.cc",
128     "sdp/sdp_discovery.cc",
129     "sdp/sdp_main.cc",
130     "sdp/sdp_server.cc",
131     "sdp/sdp_utils.cc",
132     "smp/aes.cc",
133     "smp/p_256_curvepara.cc",
134     "smp/p_256_ecc_pp.cc",
135     "smp/p_256_multprecision.cc",
136     "smp/smp_act.cc",
137     "smp/smp_api.cc",
138     "smp/smp_br_main.cc",
139     "smp/smp_cmac.cc",
140     "smp/smp_keys.cc",
141     "smp/smp_l2c.cc",
142     "smp/smp_main.cc",
143     "smp/smp_utils.cc",
144     "srvc/srvc_battery.cc",
145     "srvc/srvc_dis.cc",
146     "srvc/srvc_eng.cc",
147   ]
148
149   include_dirs = [
150     "include",
151     "avct",
152     "btm",
153     "avrc",
154     "l2cap",
155     "avdt",
156     "gatt",
157     "gap",
158     "pan",
159     "bnep",
160     "hid",
161     "sdp",
162     "smp",
163     "srvc",
164     "//btcore/include",
165     "//vnd/include",
166     "//vnd/ble",
167     "//btif/include",
168     "//hci/include",
169     "//include",
170     "//udrv/include",
171     "//rpc/include",
172     "//hcis",
173     "//ctrlr/include",
174     "//bta/include",
175     "//bta/sys",
176     "//utils/include",
177     "//",
178   ]
179
180   deps = [
181     "//types",
182     "//third_party/libchrome:base",
183     "//third_party/libldac:libldacBT_enc",
184     "//third_party/libldac:libldacBT_abr",
185     "//third_party/aac:libFraunhoferAAC",
186   ]
187 }
188
189 executable("stack_unittests") {
190   testonly = true
191   sources = [
192     "test/stack_a2dp_test.cc",
193   ]
194
195   include_dirs = [
196     "include",
197     "//",
198     "//bta/include",
199     "//bta/sys",
200     "//btcore/include",
201     "//embdrv/sbc/encoder/include",
202     "//hci/include",
203     "//include",
204     "//stack/a2dp",
205     "//stack/btm",
206     "//stack/include",
207     "//third_party/tinyxml2",
208     "//udrv/include",
209     "//utils/include",
210     "//vnd/include"
211   ]
212
213   libs = [
214     "-ldl",
215     "-lpthread",
216     "-lresolv",
217     "-lrt",
218     "-lz",
219     "-latomic",
220   ]
221
222   deps = [
223     ":stack",
224     "//osi",
225     "//btcore",
226     "//device",
227     "//embdrv/sbc",
228     "//hci",
229     "//types",
230     "//main:bluetooth.default",
231     "//third_party/googletest:gmock_main",
232     "//third_party/libchrome:base",
233   ]
234 }
235
236 executable("net_test_stack_multi_adv") {
237   testonly = true
238   sources = [
239     "btm/btm_ble_multi_adv.cc",
240     "test/ble_advertiser_test.cc",
241   ]
242
243   include_dirs = [
244     "include",
245     "//",
246     "//btcore/include",
247     "//hci/include",
248     "//include",
249     "//stack/btm",
250   ]
251
252   libs = [
253     "-ldl",
254     "-lpthread",
255     "-lresolv",
256     "-lrt",
257     "-lz",
258     "-latomic",
259   ]
260
261   deps = [
262     "//types",
263     "//third_party/googletest:gmock_main",
264     "//third_party/libchrome:base",
265   ]
266 }
267