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