195489c19Sopenharmony_ci# Copyright (C) 2024 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_CJ_DIR = "$BT_PART_DIR/frameworks/cj/connection"
1895489c19Sopenharmony_ciBT_NAPI_DIR = "$BT_PART_DIR/frameworks/js/napi"
1995489c19Sopenharmony_ci
2095489c19Sopenharmony_ciohos_shared_library("cj_bluetooth_connection_ffi") {
2195489c19Sopenharmony_ci  sanitize = {
2295489c19Sopenharmony_ci    cfi = true  # Enable/disable control flow integrity detection
2395489c19Sopenharmony_ci    boundary_sanitize = true  # Enable boundary san detection
2495489c19Sopenharmony_ci    cfi_cross_dso = true  # Cross-SO CFI Checks
2595489c19Sopenharmony_ci    integer_overflow = true  # Enable integer overflow detection
2695489c19Sopenharmony_ci    ubsan = true  # Enable some Ubsan options
2795489c19Sopenharmony_ci    debug = false
2895489c19Sopenharmony_ci  }
2995489c19Sopenharmony_ci
3095489c19Sopenharmony_ci  include_dirs = [
3195489c19Sopenharmony_ci    "$BT_CJ_DIR/include",
3295489c19Sopenharmony_ci    "$BT_CJ_DIR/src",
3395489c19Sopenharmony_ci    "$BT_NAPI_DIR/include",
3495489c19Sopenharmony_ci    "$BT_PART_DIR/frameworks/inner/include",
3595489c19Sopenharmony_ci  ]
3695489c19Sopenharmony_ci
3795489c19Sopenharmony_ci  sources = [
3895489c19Sopenharmony_ci    "src/bluetooth_connection_callback.cpp",
3995489c19Sopenharmony_ci    "src/bluetooth_connection_common.cpp",
4095489c19Sopenharmony_ci    "src/bluetooth_connection_ffi.cpp",
4195489c19Sopenharmony_ci    "src/bluetooth_connection_impl.cpp",
4295489c19Sopenharmony_ci  ]
4395489c19Sopenharmony_ci
4495489c19Sopenharmony_ci  deps = [ "$BT_PART_DIR/frameworks/inner:btframework" ]
4595489c19Sopenharmony_ci
4695489c19Sopenharmony_ci  external_deps = [
4795489c19Sopenharmony_ci    "c_utils:utils",
4895489c19Sopenharmony_ci    "hicollie:libhicollie",
4995489c19Sopenharmony_ci    "hilog:libhilog",
5095489c19Sopenharmony_ci    "napi:ace_napi",
5195489c19Sopenharmony_ci    "napi:cj_bind_ffi",
5295489c19Sopenharmony_ci    "napi:cj_bind_native",
5395489c19Sopenharmony_ci  ]
5495489c19Sopenharmony_ci
5595489c19Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
5695489c19Sopenharmony_ci  subsystem_name = "communication"
5795489c19Sopenharmony_ci  part_name = "bluetooth"
5895489c19Sopenharmony_ci}
59