1# Copyright (c) 2021-2022 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 22 if (target_cpu == "arm64") { 23 defines += [ "_ARM64_" ] 24 } 25 26 if (target_cpu == "arm64") { 27 defines += [ "APP_USE_ARM64" ] 28 } else if (target_cpu == "arm") { 29 defines += [ "APP_USE_ARM" ] 30 } 31 32 include_dirs = [] 33} 34 35config("runtime_public_config") { 36 visibility = [ ":*" ] 37 include_dirs = [ 38 "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_business_error", 39 "include", 40 ] 41} 42 43config("runtime_all_deps_config") { 44 include_dirs = [ "include" ] 45} 46 47ohos_shared_library("runtime") { 48 sources = [ 49 "${ability_runtime_native_path}/runtime/connect_server_manager.cpp", 50 "${ability_runtime_native_path}/runtime/hdc_register.cpp", 51 "${ability_runtime_native_path}/runtime/js_console_log.cpp", 52 "${ability_runtime_native_path}/runtime/js_data_struct_converter.cpp", 53 "${ability_runtime_native_path}/runtime/js_error_utils.cpp", 54 "${ability_runtime_native_path}/runtime/js_module_reader.cpp", 55 "${ability_runtime_native_path}/runtime/js_module_searcher.cpp", 56 "${ability_runtime_native_path}/runtime/js_runtime.cpp", 57 "${ability_runtime_native_path}/runtime/js_runtime_utils.cpp", 58 "${ability_runtime_native_path}/runtime/js_timer.cpp", 59 "${ability_runtime_native_path}/runtime/js_worker.cpp", 60 "${ability_runtime_native_path}/runtime/runtime.cpp", 61 "${ability_runtime_native_path}/runtime/source_map.cpp", 62 ] 63 64 configs = [ 65 ":runtime_config", 66 "//arkcompiler/ets_runtime:ark_jsruntime_public_config", 67 ] 68 69 public_configs = [ 70 ":runtime_public_config", 71 "${ability_runtime_services_path}/common:common_config", 72 ] 73 74 all_dependent_configs = [ ":runtime_all_deps_config" ] 75 76 deps = [ 77 "${ability_runtime_native_path}/ability/native:ability_business_error", 78 "${ability_runtime_native_path}/runtime:runtime_extractor", 79 "${ability_runtime_native_path}/runtime:string_utils", 80 "${third_party_path}/zlib:shared_libz", 81 "//arkcompiler/ets_runtime:libark_jsruntime", 82 "//foundation/arkui/napi:ace_napi_ark", 83 ] 84 85 external_deps = [ 86 "ability_base:configuration", 87 "ability_base:want", 88 "bundle_framework:appexecfwk_base", 89 "c_utils:utils", 90 "eventhandler:libeventhandler", 91 "hiviewdfx_hilog_native:libhilog", 92 "napi:ace_napi", 93 "resource_management:global_resmgr", 94 ] 95 96 if (is_standard_system) { 97 defines = [ "ENABLE_HITRACE" ] 98 external_deps += [ 99 "hitrace_native:libhitracechain", 100 "init:libbegetutil", 101 ] 102 } 103 104 if (ability_runtime_graphics) { 105 external_deps += [ 106 "ace_engine:ace_uicontent", 107 "napi:ace_container_scope", 108 ] 109 } 110 111 subsystem_name = "ability" 112 part_name = "ability_runtime" 113} 114