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") 15 16BT_PART_DIR = "../../../../.." 17BT_NAPI_DIR = "$BT_PART_DIR/frameworks/js/napi" 18 19ohos_shared_library("pbap") { 20 branch_protector_ret = "pac_ret" # Enable PAC CFI 21 22 include_dirs = [ 23 "$BT_NAPI_DIR/include", 24 "$BT_PART_DIR/frameworks/inner/include", 25 ] 26 27 defines = [ 28 "BT_LOG_TAG = \"bluetooth_napi\"", 29 "BT_LOG_DOMAIN = 0xD000100", 30 "ENABLE_NAPI_BLUETOOTH_MANAGER", 31 "BLUETOOTH_API_SINCE_10", 32 ] 33 34 sanitize = { 35 cfi = true # Enable/disable control flow integrity detection 36 boundary_sanitize = true # Enable boundary san detection 37 cfi_cross_dso = true # Cross-SO CFI Checks 38 integer_overflow = true # Enable integer overflow detection 39 ubsan = true # Enable some Ubsan options 40 debug = false 41 } 42 43 sources = [ 44 "$BT_NAPI_DIR/src/common/napi_async_callback.cpp", 45 "$BT_NAPI_DIR/src/common/napi_async_work.cpp", 46 "$BT_NAPI_DIR/src/common/napi_bluetooth_error.cpp", 47 "$BT_NAPI_DIR/src/common/napi_bluetooth_event.cpp", 48 "$BT_NAPI_DIR/src/common/napi_bluetooth_utils.cpp", 49 "$BT_NAPI_DIR/src/common/napi_native_object.cpp", 50 "$BT_NAPI_DIR/src/common/napi_timer.cpp", 51 "$BT_NAPI_DIR/src/parser/napi_parser_utils.cpp", 52 "napi_bluetooth_pbap_pse.cpp", 53 "napi_bluetooth_pbap_pse_observer.cpp", 54 "native_module_pbap.cpp", 55 ] 56 57 deps = [ "$BT_PART_DIR/frameworks/inner:btframework" ] 58 59 external_deps = [ 60 "ability_base:want", 61 "ability_runtime:ability_manager", 62 "bundle_framework:appexecfwk_base", 63 "bundle_framework:appexecfwk_core", 64 "c_utils:utils", 65 "hilog:libhilog", 66 "ipc:ipc_single", 67 "libuv:uv", 68 "napi:ace_napi", 69 ] 70 71 relative_install_dir = "module/bluetooth" 72 part_name = "bluetooth" 73 subsystem_name = "communication" 74} 75