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_access_taihe") { 21 sources = [ 22 "idl/ohos.bluetooth.access.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_access = "$taihe_file_path/out/$subsystem_name/$part_name/access" 32 33ohos_taihe("run_taihe") { 34 taihe_generated_file_path = "${taihe_generated_file_path_access}" 35 deps = [ ":bluetooth_access_taihe" ] 36 outputs = [ 37 "$taihe_generated_file_path/src/ohos.bluetooth.access.ani.cpp", 38 "$taihe_generated_file_path/src/ohos.bluetooth.access.abi.c", 39 ] 40} 41 42taihe_shared_library("bluetoothAccess_taihe_native") { 43 taihe_generated_file_path = "${taihe_generated_file_path_access}" 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.access.impl.cpp", 56 ] 57 deps = [ 58 ":run_taihe", 59 "$SUBSYSTEM_DIR/bluetooth/frameworks/inner:btframework", 60 ] 61 external_deps = [ 62 "c_utils:utils", 63 "hilog:libhilog", 64 ] 65 sanitize = { 66 cfi = true # Enable/disable control flow integrity detection 67 boundary_sanitize = true # Enable boundary san detection 68 cfi_cross_dso = true # Cross-SO CFI Checks 69 integer_overflow = true # Enable integer overflow detection 70 ubsan = true # Enable some Ubsan options 71 debug = false 72 } 73} 74 75generate_static_abc("bluetoothAccess_abc") { 76 base_url = "${taihe_generated_file_path_access}" 77 files = [ "${taihe_generated_file_path_access}/@ohos.bluetooth.access.ets" ] 78 is_boot_abc = "True" 79 device_dst_file = "/system/framework/bluetoothAccess_abc.abc" 80 dependencies = [ ":run_taihe" ] 81} 82 83ohos_prebuilt_etc("bluetoothAccess_etc") { 84 source = "$target_out_dir/bluetoothAccess_abc.abc" 85 module_install_dir = "framework" 86 part_name = "$part_name" 87 subsystem_name = "$subsystem_name" 88 deps = [ ":bluetoothAccess_abc" ] 89} 90 91group("bluetoothAccess_taihe") { 92 deps = [ 93 ":bluetoothAccess_etc", 94 ":bluetoothAccess_taihe_native" 95 ] 96 # deps = [":run_taihe"] 97}