# Copyright (C) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//build/ohos_var.gni") import("//foundation/communication/bluetooth_service/bluetooth.gni") SUBSYSTEM_DIR = "//foundation/communication" BT_ROOT = "//foundation/communication/bluetooth_service/services/bluetooth" ohos_shared_library("bluetooth_server") { # sanitize = { # cfi = true # blocklist = "./bluetooth_server_blocklist.txt" # } stack_protector_ret = true include_dirs = [ "include", "//foundation/communication/bluetooth/frameworks/inner/include", "//foundation/communication/bluetooth/interfaces/inner_api/include", "//foundation/communication/bluetooth_service/services/bluetooth/service/include", "//foundation/communication/bluetooth_service/services/bluetooth/service/src/ble", "//foundation/communication/bluetooth_service/services/bluetooth/service/src/permission", "//foundation/communication/bluetooth_service/services/bluetooth/stack/include", "$BT_ROOT/common", ] sources = [ "src/bluetooth_ble_advertiser_server.cpp", "src/bluetooth_ble_central_manager_server.cpp", "src/bluetooth_ble_filter_matcher.cpp", "src/bluetooth_gatt_client_server.cpp", "src/bluetooth_gatt_server_server.cpp", "src/bluetooth_hitrace.cpp", "src/bluetooth_host_dumper.cpp", "src/bluetooth_host_server.cpp", "src/bluetooth_socket_server.cpp", "src/bluetooth_utils_server.cpp", ] defines = [] if (bluetooth_service_a2dp_sink_feature) { defines += [ "BLUETOOTH_A2DP_SINK_FEATURE" ] sources += [ "src/bluetooth_a2dp_sink_server.cpp" ] } if (bluetooth_service_a2dp_source_feature) { defines += [ "BLUETOOTH_A2DP_SRC_FEATURE" ] sources += [ "src/bluetooth_a2dp_source_server.cpp" ] } if (bluetooth_service_avrcp_ct_feature) { defines += [ "BLUETOOTH_AVRCP_CT_FEATURE" ] sources += [ "src/bluetooth_avrcp_ct_server.cpp" ] } if (bluetooth_service_avrcp_tg_feature) { defines += [ "BLUETOOTH_AVRCP_TG_FEATURE" ] sources += [ "src/bluetooth_avrcp_tg_server.cpp" ] } if (bluetooth_service_hfp_ag_feature) { defines += [ "BLUETOOTH_HFP_AG_FEATURE" ] sources += [ "src/bluetooth_hfp_ag_server.cpp" ] } if (bluetooth_service_hfp_hf_feature) { defines += [ "BLUETOOTH_HFP_HF_FEATURE" ] sources += [ "src/bluetooth_hfp_hf_server.cpp" ] } if (bluetooth_service_hid_host_feature) { defines += [ "BLUETOOTH_HID_HOST_FEATURE" ] sources += [ "src/bluetooth_hid_host_server.cpp" ] } if (bluetooth_service_pan_feature) { defines += [ "BLUETOOTH_PAN_FEATURE" ] sources += [ "src/bluetooth_pan_server.cpp" ] } deps = [ "$BT_ROOT/etc/init:etc", "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/ipc:btipc_service", "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/service:btservice", ] external_deps = [ "ability_base:base", "access_token:libaccesstoken_sdk", "bluetooth:btcommon", "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] part_name = "bluetooth_service" subsystem_name = "communication" } group("bluetooth_codec") { deps = [ "$BT_ROOT/service:btsbc" ] }