• 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/taihe_idl/taihe.gni")
17
18SUBSYSTEM_DIR = "//foundation/communication"
19
20copy_taihe_idl("bluetooth_hid_taihe") {
21  sources = [
22    "idl/ohos.bluetooth.hid.taihe"
23  ]
24  deps = [
25    "$SUBSYSTEM_DIR/bluetooth/frameworks/ets/taihe/bluetooth_baseProfile:bluetooth_baseProfile_taihe"
26  ]
27}
28
29subsystem_name = "communication"
30part_name = "bluetooth"
31taihe_generated_file_path_hid = "$taihe_file_path/out/$subsystem_name/$part_name/hid"
32
33ohos_taihe("run_taihe") {
34  taihe_generated_file_path = "${taihe_generated_file_path_hid}"
35  deps = [ ":bluetooth_hid_taihe" ]
36  outputs = [
37    "$taihe_generated_file_path/src/ohos.bluetooth.hid.ani.cpp",
38    "$taihe_generated_file_path/src/ohos.bluetooth.hid.abi.c",
39  ]
40}
41
42taihe_shared_library("bluetoothHid_taihe_native") {
43  taihe_generated_file_path = "${taihe_generated_file_path_hid}"
44  part_name = "$part_name"
45  subsystem_name = "$subsystem_name"
46  sources = get_target_outputs(":run_taihe")
47  include_dirs = [
48    "include",
49    "src",
50    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
51    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include"
52  ]
53  sources += [
54    "src/ani_constructor.cpp",
55    "src/ohos.bluetooth.hid.impl.cpp",
56  ]
57  deps = [
58    ":run_taihe",
59    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner:btframework",
60    "../bluetooth_baseProfile:bluetoothBaseProfile_taihe_native"
61  ]
62  external_deps = [
63    "c_utils:utils",
64    "hilog:libhilog",
65  ]
66  sanitize = {
67    cfi = true  # Enable/disable control flow integrity detection
68    boundary_sanitize = true  # Enable boundary san detection
69    cfi_cross_dso = true  # Cross-SO CFI Checks
70    integer_overflow = true  # Enable integer overflow detection
71    ubsan = true  # Enable some Ubsan options
72    debug = false
73  }
74}
75
76generate_static_abc("bluetoothHid_abc") {
77  base_url = "${taihe_generated_file_path_hid}"
78  files = [ "${taihe_generated_file_path_hid}/@ohos.bluetooth.hid.ets" ]
79  is_boot_abc = "True"
80  device_dst_file = "/system/framework/bluetoothHid_abc.abc"
81  dependencies = [ ":run_taihe" ]
82}
83
84ohos_prebuilt_etc("bluetoothHid_etc") {
85  source = "$target_out_dir/bluetoothHid_abc.abc"
86  module_install_dir = "framework"
87  part_name = "$part_name"
88  subsystem_name = "$subsystem_name"
89  deps = [ ":bluetoothHid_abc" ]
90}
91
92group("bluetoothHid_taihe") {
93  deps = [
94    ":bluetoothHid_etc",
95    ":bluetoothHid_taihe_native"
96  ]
97  # deps = [":run_taihe"]
98}