1# 2# Copyright 2021 Google 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 17import("//common-mk/cxxbridge.gni") 18 19config("rust_topshim_config") { 20 include_dirs = [ "//bt/system/gd/rust/topshim" ] 21} 22 23cxxbridge_header("btif_bridge_header") { 24 sources = [ 25 "src/controller.rs", 26 "src/metrics.rs", 27 "src/profiles/a2dp.rs", 28 "src/profiles/avrcp.rs", 29 "src/profiles/csis.rs", 30 "src/profiles/gatt.rs", 31 "src/profiles/hfp.rs", 32 "src/profiles/vc.rs", 33 "src/profiles/le_audio.rs", 34 ] 35 all_dependent_configs = [ ":rust_topshim_config" ] 36 deps = [ ":cxxlibheader" ] 37} 38 39cxxbridge_cc("btif_bridge_code") { 40 sources = [ 41 "src/controller.rs", 42 "src/metrics.rs", 43 "src/profiles/a2dp.rs", 44 "src/profiles/avrcp.rs", 45 "src/profiles/csis.rs", 46 "src/profiles/gatt.rs", 47 "src/profiles/hfp.rs", 48 "src/profiles/vc.rs", 49 "src/profiles/le_audio.rs", 50 ] 51 deps = [ 52 ":btif_bridge_header", 53 "//bt/system/bta/aics:aics", 54 "//bt/system/pdl:BluetoothGeneratedPackets_h", 55 ] 56 configs = [ 57 "//bt/system/bta/aics:aics_defaults", 58 "//bt/system/gd:gd_defaults", 59 "//bt/system/log:log_defaults", 60 ] 61} 62 63source_set("btif_cxx_bridge_code") { 64 sources = [ 65 "btav/btav_shim.cc", 66 "btav_sink/btav_sink_shim.cc", 67 "controller/controller_shim.cc", 68 "csis/csis_shim.cc", 69 "gatt/gatt_ble_advertiser_shim.cc", 70 "gatt/gatt_ble_scanner_shim.cc", 71 "gatt/gatt_shim.cc", 72 "hfp/hfp_shim.cc", 73 "vc/vc_shim.cc", 74 "le_audio/le_audio_shim.cc", 75 "metrics/metrics_shim.cc", 76 ] 77 78 deps = [ 79 ":btif_bridge_header", 80 "//bt/system/gd/metrics:BluetoothMetricsSources", 81 "//bt/system/pdl:BluetoothGeneratedPackets_h", 82 ] 83 configs += [ 84 "//bt/system/gd:gd_defaults", 85 "//bt/system/log:log_defaults", 86 ] 87 include_dirs = [ 88 "//bt/system/bta/aics/include", 89 ] 90} 91 92cxxbridge_libheader("cxxlibheader") { 93 deps = [] 94} 95 96static_library("libbluetooth_topshim") { 97 deps = [ 98 ":btif_bridge_code", 99 ":btif_cxx_bridge_code", 100 ":cxxlibheader", 101 ] 102} 103