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") 17import("../../../../nfc.gni") 18 19copy_taihe_idl("copy_taihe_nfc_controller") { 20 sources = [ "idl/ohos.nfc.controller.nfcController.taihe" ] 21} 22 23subsystem_name = "communication" 24part_name = "nfc" 25taihe_generated_file_path_nfcController = "$taihe_file_path/out/$subsystem_name/$part_name/nfcController" 26 27ohos_taihe("run_taihe") { 28 taihe_generated_file_path = "${taihe_generated_file_path_nfcController}" 29 deps = [":copy_taihe_nfc_controller"] 30 outputs = [ 31 "$taihe_generated_file_path/src/ohos.nfc.controller.nfcController.ani.cpp", 32 "$taihe_generated_file_path/src/ohos.nfc.controller.nfcController.abi.c", 33 ] 34} 35 36taihe_shared_library("nfc_fwk_taihe_controller") { 37 sanitize = { 38 cfi = true 39 boundary_sanitize = true 40 integer_overflow = true 41 cfi_cross_dso = true 42 debug = false 43 ubsan = true 44 } 45 branch_protector_ret = "pac_ret" 46 47 taihe_generated_file_path = "${taihe_generated_file_path_nfcController}" 48 sources = get_target_outputs(":run_taihe") 49 50 defines = [ "DEBUG" ] 51 include_dirs = [ 52 "inc", 53 "$NFC_DIR/interfaces/inner_api/common", 54 ] 55 sources += [ 56 "src/ani_constructor.cpp", 57 "src/nfc_taihe_controller_event.cpp", 58 "src/impl/ohos.nfc.controller.nfcController.impl.cpp" 59 ] 60 61 external_deps = [ 62 "c_utils:utils", 63 "hilog:libhilog", 64 "ipc:ipc_core", 65 "samgr:samgr_proxy", 66 ] 67 68 deps = [ 69 ":run_taihe", 70 "$NFC_DIR/interfaces/inner_api/common:nfc_inner_kits_common", 71 "$NFC_DIR/interfaces/inner_api/controller:nfc_inner_kits_controller" 72 ] 73 74 part_name = "$part_name" 75 subsystem_name = "$subsystem_name" 76} 77 78generate_static_abc("nfc_fwk_etc_controller_abc") { 79 base_url = "${taihe_generated_file_path_nfcController}" 80 files = [ "${taihe_generated_file_path_nfcController}/@ohos.nfc.controller.ets" ] 81 is_boot_abc = "True" 82 device_dst_file = "/system/framework/nfc_fwk_etc_controller_abc.abc" 83 dependencies = [ ":run_taihe" ] 84} 85 86ohos_prebuilt_etc("nfc_fwk_etc_controller") { 87 source = "$target_out_dir/nfc_fwk_etc_controller_abc.abc" 88 deps = [ ":nfc_fwk_etc_controller_abc" ] 89 module_install_dir = "framework" 90 part_name = "$part_name" 91 subsystem_name = "$subsystem_name" 92} 93 94group("nfc_taihe_controller") { 95 deps = [ 96 ":run_taihe", 97 ":nfc_fwk_etc_controller", 98 ":nfc_fwk_taihe_controller", 99 ] 100}