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