• 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")
15
16SUBSYSTEM_DIR = "//foundation/communication"
17
18ohos_shared_library("bluetooth") {
19  branch_protector_ret = "pac_ret"  # Enable PAC CFI
20
21  #install_enable = true
22  include_dirs = [
23    "include",
24    "src",
25    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
26    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/access",
27    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/base_profile",
28    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/constant",
29  ]
30
31  defines = [
32    "BT_LOG_TAG = \"bluetooth_napi\"",
33    "BT_LOG_DOMAIN = 0xD000100",
34    "BT_MODULE_NAME = \"bluetooth\"",
35  ]
36  sanitize = {
37    cfi = true  # Enable/disable control flow integrity detection
38    boundary_sanitize = true  # Enable boundary san detection
39    cfi_cross_dso = true  # Cross-SO CFI Checks
40    integer_overflow = true  # Enable integer overflow detection
41    ubsan = true  # Enable some Ubsan options
42    debug = false
43  }
44
45  sources = [
46    "src/a2dp/napi_bluetooth_a2dp_src.cpp",
47    "src/a2dp/napi_bluetooth_a2dp_src_observer.cpp",
48    "src/access/napi_bluetooth_access.cpp",
49    "src/access/napi_bluetooth_access_observer.cpp",
50    "src/audio_manager/napi_bluetooth_audio_manager.cpp",
51    "src/base_profile/napi_bluetooth_base_profile.cpp",
52    "src/ble/napi_bluetooth_ble.cpp",
53    "src/ble/napi_bluetooth_ble_advertise_callback.cpp",
54    "src/ble/napi_bluetooth_ble_central_manager_callback.cpp",
55    "src/ble/napi_bluetooth_ble_utils.cpp",
56    "src/ble/napi_bluetooth_gatt_client.cpp",
57    "src/ble/napi_bluetooth_gatt_client_callback.cpp",
58    "src/ble/napi_bluetooth_gatt_server.cpp",
59    "src/ble/napi_bluetooth_gatt_server_callback.cpp",
60    "src/common/napi_bluetooth_profile.cpp",
61    "src/connection/napi_bluetooth_connection.cpp",
62    "src/connection/napi_bluetooth_connection_observer.cpp",
63    "src/connection/napi_bluetooth_remote_device_observer.cpp",
64    "src/constant/napi_bluetooth_constant.cpp",
65    "src/hfp/napi_bluetooth_hfp_ag.cpp",
66    "src/hfp/napi_bluetooth_hfp_ag_observer.cpp",
67    "src/hfp/napi_bluetooth_hfp_hf.cpp",
68    "src/hfp/napi_bluetooth_hfp_hf_observer.cpp",
69    "src/hid/napi_bluetooth_hid_host.cpp",
70    "src/hid/napi_bluetooth_hid_host_observer.cpp",
71    "src/napi_bluetooth_a2dp_snk.cpp",
72    "src/napi_bluetooth_a2dp_snk_observer.cpp",
73    "src/napi_bluetooth_avrcp_ct.cpp",
74    "src/napi_bluetooth_avrcp_ct_observer.cpp",
75    "src/napi_bluetooth_avrcp_tg.cpp",
76    "src/napi_bluetooth_avrcp_tg_observer.cpp",
77    "src/napi_bluetooth_host.cpp",
78    "src/native_module.cpp",
79    "src/pan/napi_bluetooth_pan.cpp",
80    "src/pan/napi_bluetooth_pan_observer.cpp",
81    "src/socket/napi_bluetooth_spp_client.cpp",
82    "src/socket/napi_bluetooth_spp_server.cpp",
83  ]
84
85  deps = [
86    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner:btframework",
87    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/common:bt_napi_common",
88  ]
89
90  external_deps = [
91    "ability_base:want",
92    "ability_runtime:ability_manager",
93    "bundle_framework:appexecfwk_base",
94    "bundle_framework:appexecfwk_core",
95    "c_utils:utils",
96    "hicollie:libhicollie",
97    "hilog:libhilog",
98    "hitrace:hitrace_meter",
99    "ipc:ipc_single",
100    "libuv:uv",
101    "napi:ace_napi",
102  ]
103
104  relative_install_dir = "module"
105  part_name = "bluetooth"
106  subsystem_name = "communication"
107}
108
109ohos_shared_library("bluetoothmanager") {
110  branch_protector_ret = "pac_ret"  # Enable PAC CFI
111
112  #install_enable = true
113  include_dirs = [
114    "include",
115    "src",
116    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
117    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/access",
118    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/base_profile",
119    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/constant",
120  ]
121
122  defines = [
123    "BT_LOG_TAG = \"bluetooth_napi\"",
124    "BT_LOG_DOMAIN = 0xD000100",
125    "ENABLE_NAPI_BLUETOOTH_MANAGER",
126    "BT_MODULE_NAME = \"bluetoothmanager\"",
127  ]
128
129  sanitize = {
130    cfi = true  # Enable/disable control flow integrity detection
131    boundary_sanitize = true  # Enable boundary san detection
132    cfi_cross_dso = true  # Cross-SO CFI Checks
133    integer_overflow = true  # Enable integer overflow detection
134    ubsan = true  # Enable some Ubsan options
135    debug = false
136  }
137  sources = [
138    "src/a2dp/napi_bluetooth_a2dp_src.cpp",
139    "src/a2dp/napi_bluetooth_a2dp_src_observer.cpp",
140    "src/access/napi_bluetooth_access.cpp",
141    "src/access/napi_bluetooth_access_observer.cpp",
142    "src/audio_manager/napi_bluetooth_audio_manager.cpp",
143    "src/base_profile/napi_bluetooth_base_profile.cpp",
144    "src/ble/napi_bluetooth_ble.cpp",
145    "src/ble/napi_bluetooth_ble_advertise_callback.cpp",
146    "src/ble/napi_bluetooth_ble_central_manager_callback.cpp",
147    "src/ble/napi_bluetooth_ble_utils.cpp",
148    "src/ble/napi_bluetooth_gatt_client.cpp",
149    "src/ble/napi_bluetooth_gatt_client_callback.cpp",
150    "src/ble/napi_bluetooth_gatt_server.cpp",
151    "src/ble/napi_bluetooth_gatt_server_callback.cpp",
152    "src/common/napi_bluetooth_profile.cpp",
153    "src/connection/napi_bluetooth_connection.cpp",
154    "src/connection/napi_bluetooth_connection_observer.cpp",
155    "src/connection/napi_bluetooth_remote_device_observer.cpp",
156    "src/constant/napi_bluetooth_constant.cpp",
157    "src/hfp/napi_bluetooth_hfp_ag.cpp",
158    "src/hfp/napi_bluetooth_hfp_ag_observer.cpp",
159    "src/hfp/napi_bluetooth_hfp_hf.cpp",
160    "src/hfp/napi_bluetooth_hfp_hf_observer.cpp",
161    "src/hid/napi_bluetooth_hid_host.cpp",
162    "src/hid/napi_bluetooth_hid_host_observer.cpp",
163    "src/napi_bluetooth_a2dp_snk.cpp",
164    "src/napi_bluetooth_a2dp_snk_observer.cpp",
165    "src/napi_bluetooth_avrcp_ct.cpp",
166    "src/napi_bluetooth_avrcp_ct_observer.cpp",
167    "src/napi_bluetooth_avrcp_tg.cpp",
168    "src/napi_bluetooth_avrcp_tg_observer.cpp",
169    "src/napi_bluetooth_host.cpp",
170    "src/native_module.cpp",
171    "src/pan/napi_bluetooth_pan.cpp",
172    "src/pan/napi_bluetooth_pan_observer.cpp",
173    "src/socket/napi_bluetooth_spp_client.cpp",
174    "src/socket/napi_bluetooth_spp_server.cpp",
175  ]
176
177  deps = [
178    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner:btframework",
179    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/common:bt_napi_common",
180  ]
181
182  external_deps = [
183    "ability_base:want",
184    "ability_runtime:ability_manager",
185    "bundle_framework:appexecfwk_base",
186    "bundle_framework:appexecfwk_core",
187    "c_utils:utils",
188    "hicollie:libhicollie",
189    "hilog:libhilog",
190    "hitrace:hitrace_meter",
191    "ipc:ipc_core",
192    "ipc:ipc_single",
193    "libuv:uv",
194    "napi:ace_napi",
195  ]
196
197  relative_install_dir = "module"
198  part_name = "bluetooth"
199  subsystem_name = "communication"
200}
201
202group("bluetooth_napi") {
203  deps = [
204    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi:bluetooth",
205    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi:bluetoothmanager",
206    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/a2dp:a2dp",
207    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/access:access",
208    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/audio_manager:weardetection",
209    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/base_profile:baseprofile",
210    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/ble:ble",
211    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/connection:connection",
212    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/constant:constant",
213    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/hfp:hfp",
214    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/hid:hid",
215    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/map:map",
216    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/opp:opp",
217    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/pan:pan",
218    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/pbap:pbap",
219    "$SUBSYSTEM_DIR/bluetooth/frameworks/js/napi/src/socket:socket",
220  ]
221}
222