1# Copyright (c) 2021-2023 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("appmgr_sdk_config") {
18  include_dirs = [
19    "include/appmgr",
20    "${ability_runtime_path}/interfaces/kits/native/ability/native",
21    "${ability_runtime_innerkits_path}/ability_manager/include",
22  ]
23  defines = []
24  if (ability_command_for_test) {
25    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
26  }
27}
28
29config("appmgr_core_config") {
30  include_dirs = [ "include" ]
31  defines = []
32  if (ability_command_for_test) {
33    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
34  }
35}
36
37ohos_shared_library("app_manager") {
38  branch_protector_ret = "pac_ret"
39
40  include_dirs = [
41    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
42    "${ability_runtime_path}/utils/global/time/include",
43    "${ability_runtime_services_path}/appdfr/include",
44    "${ability_runtime_services_path}/appmgr/include",
45    "${ability_runtime_services_path}/common/include",
46  ]
47
48  sources = [
49    "${ability_runtime_services_path}/appdfr/src/appfreeze_manager.cpp",
50    "src/appmgr/ability_controller_proxy.cpp",
51    "src/appmgr/ability_controller_stub.cpp",
52    "src/appmgr/ability_debug_response_proxy.cpp",
53    "src/appmgr/ability_debug_response_stub.cpp",
54    "src/appmgr/ability_foreground_state_observer_proxy.cpp",
55    "src/appmgr/ability_foreground_state_observer_stub.cpp",
56    "src/appmgr/ability_info_callback_proxy.cpp",
57    "src/appmgr/ability_info_callback_stub.cpp",
58    "src/appmgr/ability_state_data.cpp",
59    "src/appmgr/ams_mgr_proxy.cpp",
60    "src/appmgr/ams_mgr_stub.cpp",
61    "src/appmgr/app_debug_info.cpp",
62    "src/appmgr/app_debug_listener_proxy.cpp",
63    "src/appmgr/app_debug_listener_stub.cpp",
64    "src/appmgr/app_exception_callback_proxy.cpp",
65    "src/appmgr/app_exception_callback_stub.cpp",
66    "src/appmgr/app_exception_manager.cpp",
67    "src/appmgr/app_foreground_state_observer_proxy.cpp",
68    "src/appmgr/app_foreground_state_observer_stub.cpp",
69    "src/appmgr/app_jsheap_mem_info.cpp",
70    "src/appmgr/app_launch_data.cpp",
71    "src/appmgr/app_malloc_info.cpp",
72    "src/appmgr/app_mgr_client.cpp",
73    "src/appmgr/app_mgr_proxy.cpp",
74    "src/appmgr/app_mgr_stub.cpp",
75    "src/appmgr/app_process_data.cpp",
76    "src/appmgr/app_record_id.cpp",
77    "src/appmgr/app_running_status_proxy.cpp",
78    "src/appmgr/app_running_status_stub.cpp",
79    "src/appmgr/app_scheduler_host.cpp",
80    "src/appmgr/app_scheduler_proxy.cpp",
81    "src/appmgr/app_service_manager.cpp",
82    "src/appmgr/app_state_callback_host.cpp",
83    "src/appmgr/app_state_callback_proxy.cpp",
84    "src/appmgr/app_state_data.cpp",
85    "src/appmgr/application_state_observer_proxy.cpp",
86    "src/appmgr/application_state_observer_stub.cpp",
87    "src/appmgr/child_process_args.cpp",
88    "src/appmgr/child_process_info.cpp",
89    "src/appmgr/child_process_options.cpp",
90    "src/appmgr/child_process_request.cpp",
91    "src/appmgr/child_scheduler_proxy.cpp",
92    "src/appmgr/child_scheduler_stub.cpp",
93    "src/appmgr/configuration_observer_proxy.cpp",
94    "src/appmgr/configuration_observer_stub.cpp",
95    "src/appmgr/fault_data.cpp",
96    "src/appmgr/kia_interceptor_proxy.cpp",
97    "src/appmgr/kia_interceptor_stub.cpp",
98    "src/appmgr/memory_level_info.cpp",
99    "src/appmgr/native_child_notify_proxy.cpp",
100    "src/appmgr/native_child_notify_stub.cpp",
101    "src/appmgr/page_state_data.cpp",
102    "src/appmgr/priority_object.cpp",
103    "src/appmgr/process_data.cpp",
104    "src/appmgr/process_info.cpp",
105    "src/appmgr/profile.cpp",
106    "src/appmgr/quick_fix_callback_proxy.cpp",
107    "src/appmgr/quick_fix_callback_stub.cpp",
108    "src/appmgr/render_process_info.cpp",
109    "src/appmgr/render_scheduler_host.cpp",
110    "src/appmgr/render_scheduler_proxy.cpp",
111    "src/appmgr/render_state_data.cpp",
112    "src/appmgr/render_state_observer_proxy.cpp",
113    "src/appmgr/render_state_observer_stub.cpp",
114    "src/appmgr/running_multi_info.cpp",
115    "src/appmgr/running_process_info.cpp",
116    "src/appmgr/start_specified_ability_response_proxy.cpp",
117    "src/appmgr/start_specified_ability_response_stub.cpp",
118    "src/appmgr/system_memory_attr.cpp",
119  ]
120
121  public_configs = [
122    ":appmgr_core_config",
123    ":appmgr_sdk_config",
124  ]
125
126  defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ]
127  defines += [ "AMS_LOG_DOMAIN = 0xD001306" ]
128  cflags = []
129  if (target_cpu == "arm") {
130    cflags += [ "-DBINDER_IPC_32BIT" ]
131  }
132  deps = [
133    "${ability_runtime_path}/utils/global/freeze:freeze_util",
134    "${ability_runtime_path}/utils/server/startup:startup_util",
135  ]
136
137  external_deps = [
138    "c_utils:utils",
139    "faultloggerd:libdfx_dumpcatcher",
140    "faultloggerd:libfaultloggerd",
141    "ffrt:libffrt",
142    "hilog:libhilog",
143    "hisysevent:libhisysevent",
144    "hitrace:hitrace_meter",
145    "init:libbegetutil",
146    "ipc:ipc_core",
147    "json:nlohmann_json_static",
148    "samgr:samgr_proxy",
149  ]
150  public_external_deps = [
151    "ability_base:configuration",
152    "ability_base:session_info",
153    "ability_base:want",
154    "bundle_framework:appexecfwk_base",
155    "image_framework:image_native",
156    "relational_store:native_rdb",
157    "skia:skia_canvaskit",
158  ]
159
160  if (background_task_mgr_continuous_task_enable) {
161    defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
162  }
163
164  innerapi_tags = [ "platformsdk" ]
165  subsystem_name = "ability"
166  part_name = "ability_runtime"
167}
168