195489c19Sopenharmony_ci# Copyright (C) 2023 Huawei Device Co., Ltd.
295489c19Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
395489c19Sopenharmony_ci# you may not use this file except in compliance with the License.
495489c19Sopenharmony_ci# You may obtain a copy of the License at
595489c19Sopenharmony_ci#
695489c19Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
795489c19Sopenharmony_ci#
895489c19Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
995489c19Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1095489c19Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1195489c19Sopenharmony_ci# See the License for the specific language governing permissions and
1295489c19Sopenharmony_ci# limitations under the License.
1395489c19Sopenharmony_ci
1495489c19Sopenharmony_ciimport("//build/ohos.gni")
1595489c19Sopenharmony_ci
1695489c19Sopenharmony_ciBT_PART_DIR = "../../../../.."
1795489c19Sopenharmony_ciBT_NAPI_DIR = "$BT_PART_DIR/frameworks/js/napi"
1895489c19Sopenharmony_ciohos_shared_library("ble") {
1995489c19Sopenharmony_ci  branch_protector_ret = "pac_ret"  # Enable PAC CFI
2095489c19Sopenharmony_ci
2195489c19Sopenharmony_ci  #install_enable = true
2295489c19Sopenharmony_ci  include_dirs = [
2395489c19Sopenharmony_ci    "$BT_NAPI_DIR/include",
2495489c19Sopenharmony_ci    "$BT_PART_DIR/frameworks/inner/include",
2595489c19Sopenharmony_ci  ]
2695489c19Sopenharmony_ci
2795489c19Sopenharmony_ci  defines = [
2895489c19Sopenharmony_ci    "BT_LOG_TAG = \"bluetooth_napi\"",
2995489c19Sopenharmony_ci    "BT_LOG_DOMAIN = 0xD000100",
3095489c19Sopenharmony_ci    "ENABLE_NAPI_BLUETOOTH_MANAGER",
3195489c19Sopenharmony_ci    "BLUETOOTH_API_SINCE_10",
3295489c19Sopenharmony_ci    "BT_MODULE_NAME = \"bluetooth.ble\"",
3395489c19Sopenharmony_ci  ]
3495489c19Sopenharmony_ci
3595489c19Sopenharmony_ci  sanitize = {
3695489c19Sopenharmony_ci    cfi = true  # Enable/disable control flow integrity detection
3795489c19Sopenharmony_ci    boundary_sanitize = true  # Enable boundary san detection
3895489c19Sopenharmony_ci    cfi_cross_dso = true  # Cross-SO CFI Checks
3995489c19Sopenharmony_ci    integer_overflow = true  # Enable integer overflow detection
4095489c19Sopenharmony_ci    ubsan = true  # Enable some Ubsan options
4195489c19Sopenharmony_ci    debug = false
4295489c19Sopenharmony_ci  }
4395489c19Sopenharmony_ci
4495489c19Sopenharmony_ci  sources = [
4595489c19Sopenharmony_ci    "napi_bluetooth_ble.cpp",
4695489c19Sopenharmony_ci    "napi_bluetooth_ble_advertise_callback.cpp",
4795489c19Sopenharmony_ci    "napi_bluetooth_ble_central_manager_callback.cpp",
4895489c19Sopenharmony_ci    "napi_bluetooth_ble_utils.cpp",
4995489c19Sopenharmony_ci    "napi_bluetooth_gatt_client.cpp",
5095489c19Sopenharmony_ci    "napi_bluetooth_gatt_client_callback.cpp",
5195489c19Sopenharmony_ci    "napi_bluetooth_gatt_server.cpp",
5295489c19Sopenharmony_ci    "napi_bluetooth_gatt_server_callback.cpp",
5395489c19Sopenharmony_ci    "native_module_ble.cpp",
5495489c19Sopenharmony_ci  ]
5595489c19Sopenharmony_ci
5695489c19Sopenharmony_ci  deps = [ "$BT_PART_DIR/frameworks/inner:btframework" ]
5795489c19Sopenharmony_ci
5895489c19Sopenharmony_ci  external_deps = [
5995489c19Sopenharmony_ci    "c_utils:utils",
6095489c19Sopenharmony_ci    "hilog:libhilog",
6195489c19Sopenharmony_ci    "hitrace:hitrace_meter",
6295489c19Sopenharmony_ci    "ipc:ipc_single",
6395489c19Sopenharmony_ci    "libuv:uv",
6495489c19Sopenharmony_ci    "napi:ace_napi",
6595489c19Sopenharmony_ci  ]
6695489c19Sopenharmony_ci
6795489c19Sopenharmony_ci  relative_install_dir = "module/bluetooth"
6895489c19Sopenharmony_ci  part_name = "bluetooth"
6995489c19Sopenharmony_ci  subsystem_name = "communication"
7095489c19Sopenharmony_ci}
71