• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"
19BT_ROOT = "//foundation/communication/bluetooth_service/services/bluetooth"
20
21ohos_shared_library("bluetooth_server") {
22  # sanitize = {
23  #   cfi = true
24  #   blocklist = "./bluetooth_server_blocklist.txt"
25  # }
26  stack_protector_ret = true
27  include_dirs = [
28    "include",
29    "//foundation/communication/bluetooth/frameworks/inner/common",
30    "//foundation/communication/bluetooth/interfaces/inner_api/include",
31    "//foundation/communication/bluetooth_service/services/bluetooth/service/include",
32    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/ble",
33    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/permission",
34    "//foundation/communication/bluetooth_service/services/bluetooth/stack/include",
35  ]
36
37  sources = [
38    "src/bluetooth_ble_advertiser_server.cpp",
39    "src/bluetooth_ble_central_manager_server.cpp",
40    "src/bluetooth_gatt_client_server.cpp",
41    "src/bluetooth_gatt_server_server.cpp",
42    "src/bluetooth_hitrace.cpp",
43    "src/bluetooth_host_dumper.cpp",
44    "src/bluetooth_host_server.cpp",
45    "src/bluetooth_socket_server.cpp",
46    "src/bluetooth_utils_server.cpp",
47  ]
48
49  defines = []
50
51  if (bluetooth_service_a2dp_sink_feature) {
52    defines += [ "BLUETOOTH_A2DP_SINK_FEATURE" ]
53
54    sources += [ "src/bluetooth_a2dp_sink_server.cpp" ]
55  }
56
57  if (bluetooth_service_a2dp_source_feature) {
58    defines += [ "BLUETOOTH_A2DP_SRC_FEATURE" ]
59
60    sources += [ "src/bluetooth_a2dp_source_server.cpp" ]
61  }
62
63  if (bluetooth_service_avrcp_ct_feature) {
64    defines += [ "BLUETOOTH_AVRCP_CT_FEATURE" ]
65
66    sources += [ "src/bluetooth_avrcp_ct_server.cpp" ]
67  }
68
69  if (bluetooth_service_avrcp_tg_feature) {
70    defines += [ "BLUETOOTH_AVRCP_TG_FEATURE" ]
71
72    sources += [ "src/bluetooth_avrcp_tg_server.cpp" ]
73  }
74
75  if (bluetooth_service_hfp_ag_feature) {
76    defines += [ "BLUETOOTH_HFP_AG_FEATURE" ]
77
78    sources += [ "src/bluetooth_hfp_ag_server.cpp" ]
79  }
80
81  if (bluetooth_service_hfp_hf_feature) {
82    defines += [ "BLUETOOTH_HFP_HF_FEATURE" ]
83
84    sources += [ "src/bluetooth_hfp_hf_server.cpp" ]
85  }
86
87  if (bluetooth_service_hid_host_feature) {
88    defines += [ "BLUETOOTH_HID_HOST_FEATURE" ]
89
90    sources += [ "src/bluetooth_hid_host_server.cpp" ]
91  }
92
93  if (bluetooth_service_map_client_feature) {
94    defines += [ "BLUETOOTH_MAP_CLIENT_FEATURE" ]
95
96    sources += [ "src/bluetooth_map_mce_server.cpp" ]
97  }
98
99  if (bluetooth_service_map_server_feature) {
100    defines += [ "BLUETOOTH_MAP_SERVER_FEATURE" ]
101
102    sources += [ "src/bluetooth_map_mse_server.cpp" ]
103  }
104
105  if (bluetooth_service_opp_feature) {
106    defines += [ "BLUETOOTH_OPP_FEATURE" ]
107
108    sources += [ "src/bluetooth_opp_server.cpp" ]
109  }
110
111  if (bluetooth_service_pan_feature) {
112    defines += [ "BLUETOOTH_PAN_FEATURE" ]
113
114    sources += [ "src/bluetooth_pan_server.cpp" ]
115  }
116
117  if (bluetooth_service_pbap_client_feature) {
118    defines += [ "BLUETOOTH_PBAP_CLIENT_FEATURE" ]
119
120    sources += [ "src/bluetooth_pbap_pce_server.cpp" ]
121  }
122
123  if (bluetooth_service_pbap_server_feature) {
124    defines += [ "BLUETOOTH_PBAP_SERVER_FEATURE" ]
125
126    sources += [ "src/bluetooth_pbap_pse_server.cpp" ]
127  }
128
129  deps = [
130    "$BT_ROOT/etc/init:etc",
131    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/ipc:btipc_service",
132    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/service:btservice",
133  ]
134
135  external_deps = [
136    "access_token:libaccesstoken_sdk",
137    "bluetooth:btcommon",
138    "c_utils:utils",
139    "eventhandler:libeventhandler",
140    "hilog:libhilog",
141    "hisysevent:libhisysevent",
142    "hitrace:hitrace_meter",
143    "ipc:ipc_core",
144    "safwk:system_ability_fwk",
145    "samgr:samgr_proxy",
146  ]
147
148  part_name = "bluetooth_service"
149  subsystem_name = "communication"
150}
151
152group("bluetooth_codec") {
153  deps = [ "$BT_ROOT/service:btsbc" ]
154}
155