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. 13import("//build/config/components/ets_frontend/ets2abc_config.gni") 14import("//build/ohos.gni") 15import("//build/ohos/taihe_idl/taihe.gni") 16 17copy_taihe_idl("copy_systemCapability") { 18 sources = [ "idl/ohos.systemCapability.taihe" ] 19} 20subsystem_name = "developtools" 21part_name = "syscap_codec" 22taihe_generated_file_path = "$taihe_file_path/out/$subsystem_name/$part_name" 23 24ohos_taihe("run_taihe") { 25 taihe_generated_file_path = "$taihe_generated_file_path" 26 deps = [ ":copy_systemCapability" ] 27 outputs = [ 28 "$taihe_generated_file_path/src/ohos.systemCapability.ani.cpp", 29 "$taihe_generated_file_path/src/ohos.systemCapability.abi.c", 30 ] 31} 32 33taihe_shared_library("systemCapability_taihe_native") { 34 sanitize = { 35 cfi = true 36 cfi_cross_dso = true 37 debug = false 38 } 39 taihe_generated_file_path = "$taihe_generated_file_path" 40 part_name = "$part_name" 41 subsystem_name = "$subsystem_name" 42 sources = get_target_outputs(":run_taihe") 43 include_dirs = [ 44 "../../src", 45 "../../interfaces/inner_api", 46 "../../include", 47 "../../include/codec_config" 48 ] 49 sources += [ 50 "src/ani_constructor.cpp", 51 "src/ohos.systemCapability.impl.cpp", 52 "../../src/syscap_tool.c", 53 "../../src/create_pcid.c", 54 "../../src/endian_internal.c", 55 "../../src/common_method.c", 56 "../../src/context_tool.c", 57 "../../interfaces/inner_api/syscap_interface.c", 58 ] 59 deps = [ 60 ":run_taihe", 61 ] 62 external_deps = [ 63 "bounds_checking_function:libsec_shared", 64 ] 65 if (defined(ohos_lite)) { 66 deps += [ "//build/lite/config/component/cJSON:cjson_static" ] 67 } else { 68 external_deps += [ "cJSON:cjson_static" ] 69 } 70} 71 72generate_static_abc("systemCapability") { 73 base_url = "$taihe_generated_file_path" 74 files = [ "$taihe_generated_file_path/@ohos.systemCapability.ets" ] 75 is_boot_abc = "True" 76 device_dst_file = "/system/framework/systemCapability.abc" 77 dependencies = [ ":run_taihe" ] 78} 79 80ohos_prebuilt_etc("systemCapability_etc") { 81 source = "$target_out_dir/systemCapability.abc" 82 module_install_dir = "framework" 83 part_name = "$part_name" 84 subsystem_name = "$subsystem_name" 85 deps = [ ":systemCapability" ] 86} 87