• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  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}/services/abilitymgr/include",
56    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
57    "${ability_runtime_utils_path}/global/constant",
58  ]
59
60  sources = [
61    "${ability_runtime_native_path}/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp",
62    "${ability_runtime_native_path}/runtime/hdc_register.cpp",
63    "${ability_runtime_native_path}/runtime/js_data_struct_converter.cpp",
64    "${ability_runtime_native_path}/runtime/js_error_utils.cpp",
65    "${ability_runtime_native_path}/runtime/js_module_reader.cpp",
66    "${ability_runtime_native_path}/runtime/js_module_searcher.cpp",
67    "${ability_runtime_native_path}/runtime/js_quickfix_callback.cpp",
68    "${ability_runtime_native_path}/runtime/js_runtime.cpp",
69    "${ability_runtime_native_path}/runtime/js_runtime_lite.cpp",
70    "${ability_runtime_native_path}/runtime/js_runtime_utils.cpp",
71    "${ability_runtime_native_path}/runtime/js_worker.cpp",
72    "${ability_runtime_native_path}/runtime/ohos_js_env_logger.cpp",
73    "${ability_runtime_native_path}/runtime/ohos_js_environment_impl.cpp",
74    "${ability_runtime_native_path}/runtime/ohos_loop_handler.cpp",
75    "${ability_runtime_native_path}/runtime/runtime.cpp",
76  ]
77
78  configs = [ ":runtime_config" ]
79
80  public_configs = [
81    ":runtime_public_config",
82    "${ability_runtime_services_path}/common:common_config",
83  ]
84
85  all_dependent_configs = [ ":runtime_all_deps_config" ]
86
87  deps = [
88    "${ability_runtime_innerkits_path}/connect_server_manager:connect_server_manager",
89    "${ability_runtime_native_path}/ability/native:ability_business_error",
90    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
91    "${ability_runtime_path}/js_environment/frameworks/js_environment:js_environment",
92    "${ability_runtime_services_path}/common:app_util",
93  ]
94
95  external_deps = [
96    "ability_base:configuration",
97    "ability_base:extractortool",
98    "ability_base:extractresourcemanager",
99    "ability_base:string_utils",
100    "access_token:libaccesstoken_sdk",
101    "bundle_framework:appexecfwk_base",
102    "bundle_framework:appexecfwk_core",
103    "bundle_framework:bundle_napi_common",
104    "bundle_framework:libappexecfwk_common",
105    "c_utils:utils",
106    "config_policy:configpolicy_util",
107    "ets_runtime:libark_jsruntime",
108    "ets_utils:console",
109    "ets_utils:timer",
110    "ets_utils:worker",
111    "eventhandler:libeventhandler",
112    "ffrt:libffrt",
113    "hilog:libhilog",
114    "hitrace:hitrace_meter",
115    "init:syscap_ts",
116    "ipc:ipc_core",
117    "json:nlohmann_json_static",
118    "jsoncpp:jsoncpp",
119    "napi:ace_napi",
120    "resource_management:global_resmgr",
121    "samgr:samgr_proxy",
122    "zlib:shared_libz",
123  ]
124
125  public_external_deps = [
126    "ability_base:session_info",
127    "ability_base:want",
128  ]
129
130  defines = []
131
132  if (cj_frontend) {
133    sources += [ "${ability_runtime_native_path}/runtime/cj_runtime.cpp" ]
134
135    include_dirs +=
136        [ "${ability_runtime_path}/cj_environment/interfaces/inner_api" ]
137
138    defines += [ "CJ_FRONTEND" ]
139  }
140
141  if (is_standard_system) {
142    defines += [ "ENABLE_HITRACE" ]
143    external_deps += [
144      "hitrace:libhitracechain",
145      "init:libbegetutil",
146    ]
147  }
148
149  if (is_emulator) {
150    defines += [ "RUNTIME_EMULATOR" ]
151  }
152
153  if (ability_runtime_graphics) {
154    external_deps += [
155      "ace_engine:ace_container_scope",
156      "ace_engine:ace_forward_compatibility",
157      "ace_engine:ace_uicontent",
158    ]
159    defines += [
160      "SUPPORT_GRAPHICS",
161      "SUPPORT_SCREEN",
162    ]
163  }
164
165  innerapi_tags = [ "platformsdk" ]
166  subsystem_name = "ability"
167  part_name = "ability_runtime"
168}
169