• 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_service/services/bluetooth/service/include",
30    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/ble",
31    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/permission",
32    "//foundation/communication/bluetooth_service/services/bluetooth/stack/include",
33    "$BT_ROOT/common",
34    "$BT_ROOT/service/src/dialog",
35  ]
36
37  sources = [
38    "src/bluetooth_ble_advertiser_server.cpp",
39    "src/bluetooth_ble_central_manager_server.cpp",
40    "src/bluetooth_ble_filter_matcher.cpp",
41    "src/bluetooth_gatt_client_server.cpp",
42    "src/bluetooth_gatt_server_server.cpp",
43    "src/bluetooth_hitrace.cpp",
44    "src/bluetooth_host_dumper.cpp",
45    "src/bluetooth_host_server.cpp",
46    "src/bluetooth_socket_server.cpp",
47    "src/bluetooth_utils_server.cpp",
48  ]
49
50  defines = []
51
52  if (bluetooth_service_a2dp_sink_feature) {
53    defines += [ "BLUETOOTH_A2DP_SINK_FEATURE" ]
54
55    sources += [ "src/bluetooth_a2dp_sink_server.cpp" ]
56  }
57
58  if (bluetooth_service_a2dp_source_feature) {
59    defines += [ "BLUETOOTH_A2DP_SRC_FEATURE" ]
60
61    sources += [ "src/bluetooth_a2dp_source_server.cpp" ]
62  }
63
64  if (bluetooth_service_avrcp_ct_feature) {
65    defines += [ "BLUETOOTH_AVRCP_CT_FEATURE" ]
66
67    sources += [ "src/bluetooth_avrcp_ct_server.cpp" ]
68  }
69
70  if (bluetooth_service_avrcp_tg_feature) {
71    defines += [ "BLUETOOTH_AVRCP_TG_FEATURE" ]
72
73    sources += [ "src/bluetooth_avrcp_tg_server.cpp" ]
74  }
75
76  if (bluetooth_service_hfp_ag_feature) {
77    defines += [ "BLUETOOTH_HFP_AG_FEATURE" ]
78
79    sources += [ "src/bluetooth_hfp_ag_server.cpp" ]
80  }
81
82  if (bluetooth_service_hfp_hf_feature) {
83    defines += [ "BLUETOOTH_HFP_HF_FEATURE" ]
84
85    sources += [ "src/bluetooth_hfp_hf_server.cpp" ]
86  }
87
88  if (bluetooth_service_hid_host_feature) {
89    defines += [ "BLUETOOTH_HID_HOST_FEATURE" ]
90
91    sources += [ "src/bluetooth_hid_host_server.cpp" ]
92  }
93
94  if (bluetooth_service_pan_feature) {
95    defines += [ "BLUETOOTH_PAN_FEATURE" ]
96
97    sources += [ "src/bluetooth_pan_server.cpp" ]
98  }
99
100  deps = [
101    "$BT_ROOT/etc/init:etc",
102    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/ipc:btipc_service",
103    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/service:btservice",
104  ]
105
106  external_deps = [
107    "ability_base:base",
108    "access_token:libaccesstoken_sdk",
109    "bluetooth:btframework",
110    "bluetooth:btcommon",
111    "c_utils:utils",
112    "eventhandler:libeventhandler",
113    "hilog:libhilog",
114    "hisysevent:libhisysevent",
115    "hitrace:hitrace_meter",
116    "ipc:ipc_core",
117    "safwk:system_ability_fwk",
118    "samgr:samgr_proxy",
119  ]
120
121  part_name = "bluetooth_service"
122  subsystem_name = "communication"
123}
124
125group("bluetooth_codec") {
126  deps = [ "$BT_ROOT/service:btsbc" ]
127}
128