1# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//build/ohos_var.gni")
16import("//foundation/communication/bluetooth_service/bluetooth.gni")
17
18SUBSYSTEM_DIR = "//foundation/communication"
19
20config("btipc_public_config") {
21  include_dirs = [ "include" ]
22}
23
24ohos_static_library("btipc_service") {
25  # sanitize = {
26  #   cfi = true
27  #   blocklist = "./ipc_blocklist.txt"
28  # }
29  stack_protector_ret = true
30  public_configs = [ ":btipc_public_config" ]
31  include_dirs = [
32    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/service/src/permission",
33    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
34  ]
35  sources = [
36    "src/bluetooth_ble_advertise_callback_proxy.cpp",
37    "src/bluetooth_ble_advertiser_stub.cpp",
38    "src/bluetooth_ble_central_manager_callback_proxy.cpp",
39    "src/bluetooth_ble_central_manager_stub.cpp",
40    "src/bluetooth_ble_peripheral_observer_proxy.cpp",
41    "src/bluetooth_gatt_client_callback_proxy.cpp",
42    "src/bluetooth_gatt_client_stub.cpp",
43    "src/bluetooth_gatt_server_callback_proxy.cpp",
44    "src/bluetooth_gatt_server_stub.cpp",
45    "src/bluetooth_host_observer_proxy.cpp",
46    "src/bluetooth_host_stub.cpp",
47    "src/bluetooth_remote_device_observer_proxy.cpp",
48    "src/bluetooth_socket_observer_proxy.cpp",
49    "src/bluetooth_socket_stub.cpp",
50  ]
51
52  if (bluetooth_service_a2dp_sink_feature) {
53    sources += [
54      "src/bluetooth_a2dp_sink_observer_proxy.cpp",
55      "src/bluetooth_a2dp_sink_stub.cpp",
56    ]
57  }
58
59  if (bluetooth_service_a2dp_source_feature) {
60    sources += [
61      "src/bluetooth_a2dp_src_observer_proxy.cpp",
62      "src/bluetooth_a2dp_src_stub.cpp",
63    ]
64  }
65
66  if (bluetooth_service_avrcp_ct_feature) {
67    sources += [
68      "src/bluetooth_avrcp_ct_observer_proxy.cpp",
69      "src/bluetooth_avrcp_ct_stub.cpp",
70    ]
71  }
72
73  if (bluetooth_service_avrcp_tg_feature) {
74    sources += [
75      "src/bluetooth_avrcp_tg_observer_proxy.cpp",
76      "src/bluetooth_avrcp_tg_stub.cpp",
77    ]
78  }
79
80  if (bluetooth_service_hfp_ag_feature) {
81    sources += [
82      "src/bluetooth_hfp_ag_observer_proxy.cpp",
83      "src/bluetooth_hfp_ag_stub.cpp",
84    ]
85  }
86
87  if (bluetooth_service_hfp_hf_feature) {
88    sources += [
89      "src/bluetooth_hfp_hf_observer_proxy.cpp",
90      "src/bluetooth_hfp_hf_stub.cpp",
91    ]
92  }
93
94  if (bluetooth_service_hid_host_feature) {
95    sources += [
96      "src/bluetooth_hid_host_observer_proxy.cpp",
97      "src/bluetooth_hid_host_stub.cpp",
98    ]
99  }
100
101  if (bluetooth_service_pan_feature) {
102    sources += [
103      "src/bluetooth_pan_observer_proxy.cpp",
104      "src/bluetooth_pan_stub.cpp",
105    ]
106  }
107
108  cflags_cc = [ "-fvisibility=hidden" ]
109
110  deps = []
111
112  external_deps = [
113    "access_token:libaccesstoken_sdk",
114    "bluetooth:btcommon",
115    "c_utils:utils",
116    "hilog:libhilog",
117    "ipc:ipc_core",
118  ]
119
120  subsystem_name = "communication"
121  part_name = "bluetooth_service"
122}
123
124# Only temporary used in drivers_peripheral\bluetooth\audio
125
126config("btipc_static_public_config") {
127  visibility = [ "*" ]
128  include_dirs = [
129    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include",
130    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
131    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/common",
132    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/include",
133    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/interface",
134    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/parcel",
135    "//foundation/communication/bluetooth_service/services/bluetooth/ipc/include",
136    "//foundation/communication/bluetooth_service/services/bluetooth/common",
137  ]
138}
139
140ohos_static_library("btipc_static") {
141  stack_protector_ret = true
142  public_configs = [ ":btipc_static_public_config" ]
143
144  include_dirs = [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include" ]
145
146  sources = [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/src/bluetooth_host_proxy.cpp" ]
147
148  if (bluetooth_service_a2dp_source_feature) {
149    sources += [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/src/bluetooth_a2dp_src_proxy.cpp" ]
150  }
151
152  deps = []
153
154  external_deps = [
155    "bluetooth:btcommon",
156    "c_utils:utils",
157    "hilog:libhilog",
158    "hisysevent:libhisysevent",
159    "ipc:ipc_core",
160    "samgr:samgr_proxy",
161  ]
162
163  subsystem_name = "communication"
164  part_name = "bluetooth_service"
165}
166