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/csis.rs",
31    "src/profiles/gatt.rs",
32    "src/profiles/hfp.rs",
33    "src/profiles/vc.rs",
34    "src/profiles/le_audio.rs",
35  ]
36  all_dependent_configs = [ ":rust_topshim_config" ]
37  deps = [ ":cxxlibheader" ]
38}
39
40cxxbridge_cc("btif_bridge_code") {
41  sources = [
42    "src/btif.rs",
43    "src/controller.rs",
44    "src/metrics.rs",
45    "src/profiles/a2dp.rs",
46    "src/profiles/avrcp.rs",
47    "src/profiles/csis.rs",
48    "src/profiles/gatt.rs",
49    "src/profiles/hfp.rs",
50    "src/profiles/vc.rs",
51    "src/profiles/le_audio.rs",
52  ]
53  deps = [
54    ":btif_bridge_header",
55    "//bt/system/pdl:BluetoothGeneratedPackets_h",
56  ]
57  configs = [
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    "btif/btif_shim.cc",
68    "controller/controller_shim.cc",
69    "csis/csis_shim.cc",
70    "gatt/gatt_ble_advertiser_shim.cc",
71    "gatt/gatt_ble_scanner_shim.cc",
72    "gatt/gatt_shim.cc",
73    "hfp/hfp_shim.cc",
74    "vc/vc_shim.cc",
75    "le_audio/le_audio_shim.cc",
76    "metrics/metrics_shim.cc",
77  ]
78
79  deps = [
80    ":btif_bridge_header",
81    "//bt/system/gd/metrics:BluetoothMetricsSources",
82    "//bt/system/pdl:BluetoothGeneratedPackets_h",
83  ]
84  configs += [
85    "//bt/system/gd:gd_defaults",
86    "//bt/system/log:log_defaults",
87  ]
88}
89
90cxxbridge_libheader("cxxlibheader") {
91  deps = []
92}
93
94static_library("libbluetooth_topshim") {
95  deps = [
96    ":btif_bridge_code",
97    ":btif_cxx_bridge_code",
98    ":cxxlibheader",
99  ]
100}
101