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