1# Copyright (c) 2023-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/ohos.gni") 15import("//build/ohos/app/app.gni") 16import("//foundation/ability/form_fwk/form_fwk.gni") 17 18config("formrender_config") { 19 visibility = [ ":*" ] 20 include_dirs = [ "include" ] 21 cflags = [] 22 if (target_cpu == "arm") { 23 cflags += [ "-DBINDER_IPC_32BIT" ] 24 } 25} 26 27ohos_hap("formrender_service_hap") { 28 hap_profile = "FormRenderService/entry/src/main/module.json" 29 deps = [ 30 ":FormRender_js_assets", 31 ":FormRender_resources", 32 ] 33 shared_libraries = [ ":formrender_service" ] 34 certificate_profile = "${form_render_service_path}/signature/formrender.p7b" 35 hap_name = "Form_Render_Service" 36 part_name = "form_fwk" 37 subsystem_name = "ability" 38 module_install_dir = "app/com.ohos.formrenderservice" 39} 40 41ohos_js_assets("FormRender_js_assets") { 42 hap_profile = "FormRenderService/entry/src/main/module.json" 43 ets2abc = true 44 source_dir = "FormRenderService/entry/src/main/ets" 45} 46 47ohos_app_scope("FormRender_app_profile") { 48 app_profile = "FormRenderService/AppScope/app.json" 49 sources = [ "FormRenderService/AppScope/resources" ] 50} 51 52ohos_resources("FormRender_resources") { 53 sources = [ "FormRenderService/entry/src/main/resources" ] 54 deps = [ ":FormRender_app_profile" ] 55 hap_profile = "FormRenderService/entry/src/main/module.json" 56} 57 58ohos_shared_library("formrender") { 59 sanitize = { 60 cfi = true 61 cfi_cross_dso = true 62 debug = false 63 } 64 install_enable = true 65 66 configs = [ ":formrender_config" ] 67 68 sources = [ 69 "src/form_memmgr_client.cpp", 70 "src/form_memory_guard.cpp", 71 "src/form_module_checker.cpp", 72 "src/form_render_event_report.cpp", 73 "src/form_render_record.cpp", 74 "src/form_render_serial_queue.cpp", 75 "src/form_render_service_mgr.cpp", 76 "src/status_mgr_center/form_render_status.cpp", 77 "src/status_mgr_center/form_render_status_mgr.cpp", 78 "src/status_mgr_center/form_render_status_table.cpp", 79 "src/status_mgr_center/form_render_status_task_mgr.cpp", 80 ] 81 82 defines = [ 83 "FMS_LOG_TAG = \"FormRenderService\"", 84 "FMS_LOG_DOMAIN = 0xD001371", 85 ] 86 87 if (use_musl) { 88 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 89 defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] 90 } 91 } 92 93 deps = [ "${form_fwk_path}:form_manager" ] 94 95 external_deps = [ 96 "ability_base:configuration", 97 "ability_base:extractortool", 98 "ability_base:want", 99 "ability_runtime:ability_connect_callback_stub", 100 "ability_runtime:ability_manager", 101 "ability_runtime:abilitykit_native", 102 "ability_runtime:app_context", 103 "ability_runtime:extensionkit_native", 104 "ability_runtime:runtime", 105 "ability_runtime:service_extension", 106 "ace_engine:ace_form_render", 107 "bundle_framework:appexecfwk_base", 108 "bundle_framework:appexecfwk_core", 109 "c_utils:utils", 110 "common_event_service:cesfwk_innerkits", 111 "config_policy:configpolicy_util", 112 "ets_runtime:libark_jsruntime", 113 "eventhandler:libeventhandler", 114 "faultloggerd:libbacktrace_local", 115 "faultloggerd:libdfx_dumpcatcher", 116 "ffrt:libffrt", 117 "hicollie:libhicollie", 118 "hilog:libhilog", 119 "hisysevent:libhisysevent", 120 "hitrace:hitrace_meter", 121 "ipc:ipc_core", 122 "ipc:ipc_napi", 123 "napi:ace_napi", 124 "samgr:samgr_proxy", 125 ] 126 127 subsystem_name = "ability" 128 part_name = "form_fwk" 129} 130 131ohos_shared_library("formrender_service") { 132 sanitize = { 133 cfi = true 134 cfi_cross_dso = true 135 debug = false 136 } 137 install_enable = true 138 139 configs = [ ":formrender_config" ] 140 141 sources = [ 142 "src/form_render_impl.cpp", 143 "src/form_render_service_extension.cpp", 144 ] 145 146 defines = [ "FMS_LOG_TAG = \"FormRenderService\"" ] 147 148 if (use_musl) { 149 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 150 defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] 151 } 152 } 153 154 deps = [ 155 ":formrender", 156 "${form_fwk_path}:form_manager", 157 ] 158 159 external_deps = [ 160 "ability_base:configuration", 161 "ability_base:want", 162 "ability_runtime:ability_manager", 163 "ability_runtime:abilitykit_native", 164 "ability_runtime:app_context", 165 "ability_runtime:runtime", 166 "ability_runtime:service_extension", 167 "ace_engine:ace_form_render", 168 "c_utils:utils", 169 "common_event_service:cesfwk_innerkits", 170 "ets_runtime:libark_jsruntime", 171 "eventhandler:libeventhandler", 172 "ffrt:libffrt", 173 "hilog:libhilog", 174 "hisysevent:libhisysevent", 175 "hitrace:hitrace_meter", 176 "ipc:ipc_core", 177 "ipc:ipc_napi", 178 "napi:ace_napi", 179 ] 180 181 defines = [] 182 if (form_runtime_power) { 183 defines = [ "SUPPORT_POWER" ] 184 external_deps += [ "power_manager:powermgr_client" ] 185 } 186 187 subsystem_name = "ability" 188 part_name = "form_fwk" 189} 190