1# Copyright (c) 2021-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("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17config("runtime_config") { 18 visibility = [ ":*" ] 19 20 defines = [ "AMS_LOG_TAG = \"Runtime\"" ] 21 defines += [ "AMS_LOG_DOMAIN = 0xD001309" ] 22 23 if (target_cpu == "arm64") { 24 defines += [ "_ARM64_" ] 25 } 26 27 if (target_cpu == "arm64") { 28 defines += [ "APP_USE_ARM64" ] 29 } else if (target_cpu == "arm") { 30 defines += [ "APP_USE_ARM" ] 31 } else if (target_cpu == "x86_64") { 32 defines += [ "APP_USE_X86_64" ] 33 } 34 35 include_dirs = [] 36} 37 38config("runtime_public_config") { 39 visibility = [ ":*" ] 40 visibility += [ "${ability_runtime_napi_path}/inner/napi_common:napi_common" ] 41 include_dirs = [ 42 "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_business_error", 43 "include", 44 ] 45} 46 47config("runtime_all_deps_config") { 48 include_dirs = [ "include" ] 49} 50 51ohos_shared_library("runtime") { 52 branch_protector_ret = "pac_ret" 53 54 include_dirs = [ 55 "${ability_runtime_path}/ets_environment/interfaces/inner_api", 56 "${ability_runtime_path}/frameworks/ets/ani/ani_common/include", 57 "${ability_runtime_path}/services/abilitymgr/include", 58 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", 59 "${ability_runtime_utils_path}/global/constant", 60 ] 61 62 sources = [ 63 "${ability_runtime_native_path}/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp", 64 "${ability_runtime_native_path}/runtime/ets_native_lib_util.cpp", 65 "${ability_runtime_native_path}/runtime/ets_runtime.cpp", 66 "${ability_runtime_native_path}/runtime/hdc_register.cpp", 67 "${ability_runtime_native_path}/runtime/hybrid_js_module_reader.cpp", 68 "${ability_runtime_native_path}/runtime/js_app_process_state.cpp", 69 "${ability_runtime_native_path}/runtime/js_data_struct_converter.cpp", 70 "${ability_runtime_native_path}/runtime/js_error_utils.cpp", 71 "${ability_runtime_native_path}/runtime/js_module_reader.cpp", 72 "${ability_runtime_native_path}/runtime/js_module_searcher.cpp", 73 "${ability_runtime_native_path}/runtime/js_quickfix_callback.cpp", 74 "${ability_runtime_native_path}/runtime/js_runtime.cpp", 75 "${ability_runtime_native_path}/runtime/js_runtime_common.cpp", 76 "${ability_runtime_native_path}/runtime/js_runtime_lite.cpp", 77 "${ability_runtime_native_path}/runtime/js_runtime_utils.cpp", 78 "${ability_runtime_native_path}/runtime/js_worker.cpp", 79 "${ability_runtime_native_path}/runtime/ohos_js_env_logger.cpp", 80 "${ability_runtime_native_path}/runtime/ohos_js_environment_impl.cpp", 81 "${ability_runtime_native_path}/runtime/ohos_loop_handler.cpp", 82 "${ability_runtime_native_path}/runtime/runtime.cpp", 83 ] 84 85 configs = [ ":runtime_config" ] 86 87 public_configs = [ 88 ":runtime_public_config", 89 "${ability_runtime_services_path}/common:common_config", 90 ] 91 92 deps = [ 93 "${ability_runtime_innerkits_path}/app_manager:app_manager", 94 "${ability_runtime_innerkits_path}/connect_server_manager:connect_server_manager", 95 "${ability_runtime_native_path}/ability/native:ability_business_error", 96 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 97 "${ability_runtime_path}/js_environment/frameworks/js_environment:js_environment", 98 "${ability_runtime_services_path}/common:app_util", 99 "${ability_runtime_services_path}/common:record_cost_time_util", 100 ] 101 102 external_deps = [ 103 "ability_base:configuration", 104 "ability_base:extractortool", 105 "ability_base:extractresourcemanager", 106 "ability_base:string_utils", 107 "access_token:libaccesstoken_sdk", 108 "bundle_framework:appexecfwk_base", 109 "bundle_framework:appexecfwk_core", 110 "bundle_framework:bundle_napi_common", 111 "bundle_framework:libappexecfwk_common", 112 "c_utils:utils", 113 "config_policy:configpolicy_util", 114 "ets_runtime:libark_jsruntime", 115 "ets_utils:console", 116 "ets_utils:timer", 117 "ets_utils:worker", 118 "eventhandler:libeventhandler", 119 "ffrt:libffrt", 120 "hilog:libhilog", 121 "hitrace:hitrace_meter", 122 "i18n:intl_register", 123 "init:syscap_ts", 124 "ipc:ipc_core", 125 "json:nlohmann_json_static", 126 "napi:ace_napi", 127 "resource_management:global_resmgr", 128 "runtime_core:libarkruntime", 129 "samgr:samgr_proxy", 130 "zlib:shared_libz", 131 "faultloggerd:libfaultloggerd", 132 ] 133 134 public_external_deps = [ 135 "ability_base:session_info", 136 "ability_base:want", 137 ] 138 139 defines = [] 140 141 if (cj_frontend) { 142 sources += [ "${ability_runtime_native_path}/runtime/cj_runtime.cpp" ] 143 144 include_dirs += 145 [ "${ability_runtime_path}/cj_environment/interfaces/inner_api" ] 146 147 defines += [ "CJ_FRONTEND" ] 148 } 149 150 if (is_standard_system) { 151 defines += [ "ENABLE_HITRACE" ] 152 external_deps += [ 153 "hitrace:libhitracechain", 154 "init:libbegetutil", 155 ] 156 } 157 158 if (is_emulator) { 159 defines += [ "RUNTIME_EMULATOR" ] 160 } 161 162 if (ability_runtime_graphics) { 163 external_deps += [ 164 "ace_engine:ace_container_scope", 165 "ace_engine:ace_forward_compatibility", 166 "ace_engine:ace_uicontent", 167 ] 168 defines += [ 169 "SUPPORT_GRAPHICS", 170 "SUPPORT_SCREEN", 171 ] 172 } 173 174 innerapi_tags = [ "platformsdk" ] 175 subsystem_name = "ability" 176 part_name = "ability_runtime" 177} 178