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/btif.rs", 26 "src/controller.rs", 27 "src/metrics.rs", 28 "src/profiles/a2dp.rs", 29 "src/profiles/avrcp.rs", 30 "src/profiles/gatt.rs", 31 "src/profiles/hfp.rs", 32 ] 33 all_dependent_configs = [ ":rust_topshim_config" ] 34 deps = [ ":cxxlibheader" ] 35} 36 37cxxbridge_cc("btif_bridge_code") { 38 sources = [ 39 "src/btif.rs", 40 "src/controller.rs", 41 "src/metrics.rs", 42 "src/profiles/a2dp.rs", 43 "src/profiles/avrcp.rs", 44 "src/profiles/gatt.rs", 45 "src/profiles/hfp.rs", 46 ] 47 deps = [ 48 ":btif_bridge_header", 49 "//bt/system/gd:BluetoothGeneratedPackets_h", 50 ] 51 configs = [ "//bt/system/gd:gd_defaults" ] 52} 53 54source_set("btif_cxx_bridge_code") { 55 sources = [ 56 "btav/btav_shim.cc", 57 "btav_sink/btav_sink_shim.cc", 58 "btif/btif_shim.cc", 59 "controller/controller_shim.cc", 60 "gatt/gatt_ble_advertiser_shim.cc", 61 "gatt/gatt_ble_scanner_shim.cc", 62 "gatt/gatt_shim.cc", 63 "hfp/hfp_shim.cc", 64 "metrics/metrics_shim.cc", 65 ] 66 67 deps = [ 68 ":btif_bridge_header", 69 "//bt/system/gd:BluetoothGeneratedPackets_h", 70 "//bt/system/gd/metrics:BluetoothMetricsSources", 71 ] 72 configs += [ "//bt/system/gd:gd_defaults" ] 73} 74 75cxxbridge_libheader("cxxlibheader") { 76 deps = [] 77} 78 79static_library("libbluetooth_topshim") { 80 deps = [ 81 ":btif_bridge_code", 82 ":btif_cxx_bridge_code", 83 ":cxxlibheader", 84 ] 85} 86