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 17static_library("crypto_toolbox") { 18 sources = [ 19 "crypto_toolbox/aes.cc", 20 "crypto_toolbox/aes_cmac.cc", 21 "crypto_toolbox/crypto_toolbox.cc", 22 ] 23 24 include_dirs = [ "//bt/system/" ] 25 26 configs += [ "//bt/system:target_defaults" ] 27} 28 29source_set("nonstandard_codecs") { 30 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", 35 "a2dp/a2dp_vendor.cc", 36 "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_decoder.cc", 42 "a2dp/a2dp_vendor_ldac_encoder.cc", 43 ] 44 45 include_dirs = [ 46 "//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", 52 ] 53 54 deps = [ "//bt/system/gd/rust/shim:init_flags_bridge_header" ] 55 56 configs += [ 57 "//bt/system:target_defaults", 58 "//bt/system:external_libldac", 59 "//bt/system:external_aac", 60 ] 61 } 62} 63 64source_set("stack") { 65 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", 72 "acl/acl.cc", 73 "acl/ble_acl.cc", 74 "acl/btm_acl.cc", 75 "acl/btm_ble_connection_establishment.cc", 76 "acl/btm_pm.cc", 77 "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", 91 "avdt/avdt_scb_act.cc", 92 "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", 103 "btm/ble_advertiser_hci_interface.cc", 104 "btm/ble_scanner_hci_interface.cc", 105 "btm/btm_ble.cc", 106 "btm/btm_ble_addr.cc", 107 "btm/btm_ble_adv_filter.cc", 108 "btm/btm_ble_batchscan.cc", 109 "btm/btm_ble_bgconn.cc", 110 "btm/btm_ble_cont_energy.cc", 111 "btm/btm_ble_gap.cc", 112 "btm/btm_ble_multi_adv.cc", 113 "btm/btm_ble_privacy.cc", 114 "btm/btm_ble_scanner.cc", 115 "btm/btm_client_interface.cc", 116 "btm/btm_dev.cc", 117 "btm/btm_devctl.cc", 118 "btm/btm_inq.cc", 119 "btm/btm_iso.cc", 120 "btm/btm_main.cc", 121 "btm/btm_scn.cc", 122 "btm/btm_sco.cc", 123 "btm/btm_sco_hci.cc", 124 "btm/btm_sec.cc", 125 "btu/btu_hcif.cc", 126 "btu/btu_task.cc", 127 "eatt/eatt.cc", 128 "gap/gap_ble.cc", 129 "gap/gap_conn.cc", 130 "gatt/att_protocol.cc", 131 "gatt/connection_manager.cc", 132 "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", 139 "gatt/gatt_sr_hash.cc", 140 "gatt/gatt_utils.cc", 141 "hcic/hciblecmds.cc", 142 "hcic/hcicmds.cc", 143 "hid/hidd_api.cc", 144 "hid/hidd_conn.cc", 145 "hid/hidh_api.cc", 146 "hid/hidh_conn.cc", 147 "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", 153 "l2cap/l2c_utils.cc", 154 "metrics/stack_metrics_logging.cc", 155 "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", 173 "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", 179 "smp/smp_keys.cc", 180 "smp/smp_l2c.cc", 181 "smp/smp_main.cc", 182 "smp/smp_utils.cc", 183 "srvc/srvc_dis.cc", 184 "srvc/srvc_eng.cc", 185 ] 186 187 include_dirs = [ 188 ".", 189 "include", 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/types", 206 "//bt/system/linux_include", 207 "//bt/system/internal_include", 208 "//bt/system/vnd/include", 209 "//bt/system/vnd/ble", 210 "//bt/system/btif/include", 211 "//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/", 219 ] 220 221 deps = [ 222 ":crypto_toolbox", 223 ":nonstandard_codecs", 224 "//bt/system:libbt-platform-protos-lite", 225 "//bt/system/gd/rust/shim:init_flags_bridge_header", 226 "//bt/system/types", 227 "//bt/system/types", 228 ] 229 230 configs += [ "//bt/system:target_defaults" ] 231} 232 233if (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 ] 242 243 include_dirs = [ 244 "btm", 245 "include", 246 "test/common", 247 "//bt/system/internal_include", 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/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", 284 ] 285 286 libs = [ 287 "dl", 288 "pthread", 289 "resolv", 290 "rt", 291 "z", 292 ] 293 294 deps = [ 295 ":stack", 296 "//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", 304 ] 305 306 configs += [ 307 "//bt/system:external_tinyxml2", 308 "//bt/system:external_gmock_main", 309 "//bt/system:target_defaults", 310 ] 311 } 312 313 executable("net_test_stack_crypto_toolbox") { 314 sources = [ "test/crypto_toolbox_test.cc" ] 315 316 include_dirs = [ "//bt/system/" ] 317 318 deps = [ ":crypto_toolbox" ] 319 320 configs += [ 321 "//bt/system:external_gmock_main", 322 "//bt/system:target_defaults", 323 ] 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 = [ 339 "//bt/system/", 340 "//bt/system/linux_include", 341 "//bt/system/internal_include", 342 "//bt/system/utils/include", 343 "//bt/system/bta/include", 344 "//bt/system/bta/sys", 345 "//bt/system/embdrv/sbc/encoder/include", 346 "//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", 354 ] 355 356 libs = [ 357 "dl", 358 "pthread", 359 "resolv", 360 "rt", 361 "z", 362 ] 363 364 deps = [ 365 ":crypto_toolbox", 366 "//bt/system/osi", 367 "//bt/system/types", 368 ] 369 370 configs += [ 371 "//bt/system:external_tinyxml2", 372 "//bt/system:external_gmock_main", 373 "//bt/system:target_defaults", 374 ] 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", 385 "//bt/system/", 386 "//bt/system/internal_include", 387 "//bt/system/stack/btm", 388 ] 389 390 libs = [ 391 "dl", 392 "pthread", 393 "resolv", 394 "rt", 395 "z", 396 ] 397 398 deps = [ "//bt/system/types" ] 399 400 configs += [ 401 "//bt/system:external_gmock_main", 402 "//bt/system:target_defaults", 403 ] 404 } 405} 406