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_config") { 18 include_dirs = [ 19 "include", 20 "//third_party/json/include", 21 "${ability_runtime_services_path}/common/include", 22 "${appspawn_path}/interfaces/innerkits/include", 23 "${ability_runtime_path}/tools/aa/include", 24 ] 25} 26 27group("appms_target") { 28 deps = [ ":libappms" ] 29} 30 31ohos_shared_library("libappms") { 32 shlib_type = "sa" 33 sources = [ 34 "src/ability_running_record.cpp", 35 "src/ams_mgr_scheduler.cpp", 36 "src/app_death_recipient.cpp", 37 "src/app_lifecycle_deal.cpp", 38 "src/app_mgr_service.cpp", 39 "src/app_mgr_service_event_handler.cpp", 40 "src/app_mgr_service_inner.cpp", 41 "src/app_process_manager.cpp", 42 "src/app_running_manager.cpp", 43 "src/app_running_record.cpp", 44 "src/app_spawn_client.cpp", 45 "src/app_spawn_msg_wrapper.cpp", 46 "src/app_spawn_socket.cpp", 47 "src/app_state_observer_manager.cpp", 48 "src/module_running_record.cpp", 49 "src/quick_fix_callback_with_record.cpp", 50 "src/remote_client_manager.cpp", 51 "src/window_focus_changed_listener.cpp", 52 ] 53 54 defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ] 55 56 if (product_name != "ohcore") { 57 defines += [ "APP_MGR_SERVICE_APPMS" ] 58 } 59 60 if (ability_command_for_test) { 61 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 62 } 63 64 if (ability_fault_and_exit_test) { 65 defines += [ "ABILITY_FAULT_AND_EXIT_TEST" ] 66 } 67 68 configs = [ ":appmgr_config" ] 69 cflags = [] 70 if (target_cpu == "arm") { 71 cflags += [ "-DBINDER_IPC_32BIT" ] 72 } 73 deps = [ 74 "${ability_runtime_innerkits_path}/app_manager:app_manager", 75 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 76 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 77 "${ability_runtime_services_path}/common:event_report", 78 "${ability_runtime_services_path}/common:perm_verification", 79 "${ability_runtime_services_path}/common:task_handler_wrap", 80 ] 81 82 external_deps = [ 83 "ability_base:base", 84 "ability_base:configuration", 85 "ability_base:want", 86 "access_token:libaccesstoken_sdk", 87 "appspawn:appspawn_socket_client", 88 "bundle_framework:appexecfwk_base", 89 "bundle_framework:appexecfwk_core", 90 "common_event_service:cesfwk_innerkits", 91 "ffrt:libffrt", 92 "hicollie:libhicollie", 93 "hilog:libhilog", 94 "hisysevent:libhisysevent", 95 "hitrace:hitrace_meter", 96 "init:libbeget_proxy", 97 "init:libbegetutil", 98 "ipc:ipc_core", 99 "memory_utils:libmeminfo", 100 "safwk:system_ability_fwk", 101 "samgr:samgr_proxy", 102 "window_manager:libwsutils", 103 ] 104 105 if (product_name != "ohcore") { 106 external_deps += [ "netmanager_base:socket_permission" ] 107 } 108 109 if (ability_runtime_graphics) { 110 defines += [ "SUPPORT_GRAPHICS" ] 111 deps += [] 112 external_deps += [ 113 "i18n:intl_util", 114 "window_manager:libwm", 115 ] 116 } 117 118 if (background_task_mgr_continuous_task_enable) { 119 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 120 } 121 122 if (is_asan) { 123 defines += [ "SUPPORT_ASAN" ] 124 } 125 126 version_script = "libappms.map" 127 subsystem_name = "ability" 128 part_name = "ability_runtime" 129} 130