1# Copyright (C) 2023 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("//foundation/communication/bluetooth/bluetooth.gni") 16 17BT_PART_DIR = "../../../../.." 18BT_NAPI_DIR = "$BT_PART_DIR/frameworks/js/napi" 19 20ohos_shared_library("socket") { 21 branch_protector_ret = "pac_ret" # Enable PAC CFI 22 23 #install_enable = true 24 include_dirs = [ 25 "$BT_NAPI_DIR/include", 26 "$BT_NAPI_DIR/src", 27 "$BT_PART_DIR/frameworks/inner/include", 28 ] 29 30 defines = [ 31 "BT_LOG_TAG = \"bluetooth_napi\"", 32 "BT_LOG_DOMAIN = 0xD000100", 33 "ENABLE_NAPI_BLUETOOTH_MANAGER", 34 "BLUETOOTH_API_SINCE_10", 35 "BT_MODULE_NAME = \"bluetooth.socket\"", 36 ] 37 38 sanitize = { 39 cfi = true # Enable/disable control flow integrity detection 40 boundary_sanitize = true # Enable boundary san detection 41 cfi_cross_dso = true # Cross-SO CFI Checks 42 integer_overflow = true # Enable integer overflow detection 43 ubsan = true # Enable some Ubsan options 44 debug = false 45 } 46 47 sources = [ 48 "$BT_NAPI_DIR/src/socket/napi_bluetooth_spp_client.cpp", 49 "$BT_NAPI_DIR/src/socket/napi_bluetooth_spp_server.cpp", 50 "$BT_NAPI_DIR/src/socket/native_module_socket.cpp", 51 ] 52 53 deps = [ 54 "$BT_PART_DIR/frameworks/inner:btframework", 55 "$BT_PART_DIR/frameworks/js/napi/src/common:bt_napi_common", 56 ] 57 58 external_deps = [ 59 "ability_base:want", 60 "ability_runtime:ability_manager", 61 "bundle_framework:appexecfwk_base", 62 "bundle_framework:appexecfwk_core", 63 "c_utils:utils", 64 "hilog:libhilog", 65 "hitrace:hitrace_meter", 66 "ipc:ipc_single", 67 "libuv:uv", 68 "napi:ace_napi", 69 ] 70 71 if (bluetooth_kia_enable) { 72 defines += [ "BLUETOOTH_KIA_ENABLE" ] 73 external_deps += [ 74 "cJSON:cjson", 75 "security_guard:libsg_collect_sdk", 76 ] 77 } 78 79 relative_install_dir = "module/bluetooth" 80 part_name = "bluetooth" 81 subsystem_name = "communication" 82} 83