• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2025 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
16ohos_shared_library("cj_bluetooth_socket_ffi") {
17  branch_protector_ret = "pac_ret"  # Enable PAC CFI
18  sanitize = {
19    cfi = true  # Enable/disable control flow integrity detection
20    boundary_sanitize = true  # Enable boundary san detection
21    cfi_cross_dso = true  # Cross-SO CFI Checks
22    integer_overflow = true  # Enable integer overflow detection
23    ubsan = true  # Enable some Ubsan options
24    debug = false
25  }
26
27  if (!defined(defines)) {
28    defines = []
29  }
30  include_dirs = [
31    "include",
32    "../../js/napi/include",
33    "../../../frameworks/inner/include",
34  ]
35
36  deps = [
37    "../../../frameworks/inner:btframework",
38    "../../../frameworks/js/napi/src/common:bt_napi_common",
39  ]
40
41  external_deps = [
42    "c_utils:utils",
43    "hilog:libhilog",
44    "napi:ace_napi",
45    "napi:cj_bind_ffi",
46    "napi:cj_bind_native",
47  ]
48
49  sources = [
50    "src/bluetooth_spp_client_impl.cpp",
51    "src/bluetooth_spp_ffi.cpp",
52    "src/bluetooth_spp_server_impl.cpp",
53    "src/bluetooth_spp_utils.cpp",
54  ]
55
56  if (is_ohos) {
57    defines += [ "OHOS_PLATFORM" ]
58  }
59
60  if (is_mingw) {
61    defines += [ "WINDOWS_PLATFORM" ]
62  }
63
64  innerapi_tags = [ "platformsdk" ]
65
66  part_name = "bluetooth"
67  subsystem_name = "communication"
68}
69