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_ci
1995489c19Sopenharmony_ciohos_shared_library("hid") {
2095489c19Sopenharmony_ci  branch_protector_ret = "pac_ret"  # Enable PAC CFI
2195489c19Sopenharmony_ci
2295489c19Sopenharmony_ci  #install_enable = true
2395489c19Sopenharmony_ci  include_dirs = [
2495489c19Sopenharmony_ci    "$BT_NAPI_DIR/include",
2595489c19Sopenharmony_ci    "$BT_PART_DIR/frameworks/inner/include",
2695489c19Sopenharmony_ci  ]
2795489c19Sopenharmony_ci
2895489c19Sopenharmony_ci  defines = [
2995489c19Sopenharmony_ci    "BT_LOG_TAG = \"bluetooth_napi\"",
3095489c19Sopenharmony_ci    "BT_LOG_DOMAIN = 0xD000100",
3195489c19Sopenharmony_ci    "ENABLE_NAPI_BLUETOOTH_MANAGER",
3295489c19Sopenharmony_ci    "BLUETOOTH_API_SINCE_10",
3395489c19Sopenharmony_ci    "BT_MODULE_NAME = \"bluetooth.hid\"",
3495489c19Sopenharmony_ci  ]
3595489c19Sopenharmony_ci
3695489c19Sopenharmony_ci  sanitize = {
3795489c19Sopenharmony_ci    cfi = true  # Enable/disable control flow integrity detection
3895489c19Sopenharmony_ci    boundary_sanitize = true  # Enable boundary san detection
3995489c19Sopenharmony_ci    cfi_cross_dso = true  # Cross-SO CFI Checks
4095489c19Sopenharmony_ci    integer_overflow = true  # Enable integer overflow detection
4195489c19Sopenharmony_ci    ubsan = true  # Enable some Ubsan options
4295489c19Sopenharmony_ci    debug = false
4395489c19Sopenharmony_ci  }
4495489c19Sopenharmony_ci
4595489c19Sopenharmony_ci  sources = [
4695489c19Sopenharmony_ci    "$BT_NAPI_DIR/src/common/napi_bluetooth_profile.cpp",
4795489c19Sopenharmony_ci    "napi_bluetooth_hid_host.cpp",
4895489c19Sopenharmony_ci    "napi_bluetooth_hid_host_observer.cpp",
4995489c19Sopenharmony_ci    "native_module_hid.cpp",
5095489c19Sopenharmony_ci  ]
5195489c19Sopenharmony_ci
5295489c19Sopenharmony_ci  deps = [ "$BT_PART_DIR/frameworks/inner:btframework" ]
5395489c19Sopenharmony_ci
5495489c19Sopenharmony_ci  external_deps = [
5595489c19Sopenharmony_ci    "ability_base:want",
5695489c19Sopenharmony_ci    "ability_runtime:ability_manager",
5795489c19Sopenharmony_ci    "bundle_framework:appexecfwk_base",
5895489c19Sopenharmony_ci    "bundle_framework:appexecfwk_core",
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