1# Copyright (C) 2024 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_CJ_DIR = "$BT_PART_DIR/frameworks/cj/connection"
18BT_NAPI_DIR = "$BT_PART_DIR/frameworks/js/napi"
19
20ohos_shared_library("cj_bluetooth_connection_ffi") {
21  sanitize = {
22    cfi = true  # Enable/disable control flow integrity detection
23    boundary_sanitize = true  # Enable boundary san detection
24    cfi_cross_dso = true  # Cross-SO CFI Checks
25    integer_overflow = true  # Enable integer overflow detection
26    ubsan = true  # Enable some Ubsan options
27    debug = false
28  }
29
30  include_dirs = [
31    "$BT_CJ_DIR/include",
32    "$BT_CJ_DIR/src",
33    "$BT_NAPI_DIR/include",
34    "$BT_PART_DIR/frameworks/inner/include",
35  ]
36
37  sources = [
38    "src/bluetooth_connection_callback.cpp",
39    "src/bluetooth_connection_common.cpp",
40    "src/bluetooth_connection_ffi.cpp",
41    "src/bluetooth_connection_impl.cpp",
42  ]
43
44  deps = [ "$BT_PART_DIR/frameworks/inner:btframework" ]
45
46  external_deps = [
47    "c_utils:utils",
48    "hicollie:libhicollie",
49    "hilog:libhilog",
50    "napi:ace_napi",
51    "napi:cj_bind_ffi",
52    "napi:cj_bind_native",
53  ]
54
55  innerapi_tags = [ "platformsdk" ]
56  subsystem_name = "communication"
57  part_name = "bluetooth"
58}
59