1# Copyright (c) 2021 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/appexecfwk/standard/appexecfwk.gni") 16 17config("appmgr_config") { 18 include_dirs = [ 19 "include", 20 "${appspawn_path}/include", 21 "//utils/system/safwk/native/include", 22 "//base/notification/ces_standard/frameworks/core/include", 23 "//base/notification/ces_standard/interfaces/innerkits/native/include", 24 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", 25 ] 26} 27 28group("ams_target") { 29 deps = [ 30 ":libams", 31 ":lmks", 32 ":lmks.rc", 33 "examples:appmgrserviceregtest", 34 "examples:appspawnclienttest", 35 ] 36} 37 38ohos_executable("lmks") { 39 include_dirs = [ 40 "include/lmks", 41 "//utils/native/base/include", 42 ] 43 44 sources = [ 45 "src/lmks/lmks_main.cpp", 46 "src/lmks/lmks_server.cpp", 47 "src/lmks/lmks_utils.cpp", 48 ] 49 50 cflags = [] 51 if (target_cpu == "arm") { 52 cflags += [ "-DBINDER_IPC_32BIT" ] 53 } 54 55 deps = [ "//utils/native/base:utils" ] 56 57 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 58 59 install_enable = true 60 subsystem_name = "appexecfwk" 61 part_name = "appexecfwk_standard" 62} 63 64ohos_prebuilt_etc("lmks.rc") { 65 if (use_musl) { 66 source = "lmks.cfg" 67 } else { 68 source = "lmks.rc" 69 } 70 relative_install_dir = "init" 71 subsystem_name = "appexecfwk" 72 part_name = "appexecfwk_standard" 73} 74 75ohos_shared_library("libams") { 76 sources = [ 77 "src/ability_running_record.cpp", 78 "src/ams_mgr_scheduler.cpp", 79 "src/app_death_recipient.cpp", 80 "src/app_lifecycle_deal.cpp", 81 "src/app_mgr_service.cpp", 82 "src/app_mgr_service_event_handler.cpp", 83 "src/app_mgr_service_inner.cpp", 84 "src/app_process_manager.cpp", 85 "src/app_running_manager.cpp", 86 "src/app_running_record.cpp", 87 "src/app_spawn_client.cpp", 88 "src/app_spawn_msg_wrapper.cpp", 89 "src/app_spawn_socket.cpp", 90 "src/cgroup_manager.cpp", 91 "src/lmks_client.cpp", 92 "src/process_optimizer.cpp", 93 "src/process_optimizer_uba.cpp", 94 "src/remote_client_manager.cpp", 95 ] 96 97 defines = [ 98 "APP_LOG_TAG = \"AppMgrService\"", 99 "LOG_DOMAIN = 0xD001110", 100 ] 101 102 configs = [ 103 ":appmgr_config", 104 "${libs_path}/libeventhandler:libeventhandler_config", 105 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appmgr_sdk_config", 106 ] 107 cflags = [] 108 if (target_cpu == "arm") { 109 cflags += [ "-DBINDER_IPC_32BIT" ] 110 } 111 deps = [ 112 "${appexecfwk_path}/common:libappexecfwk_common", 113 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", 114 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 115 "${libs_path}/libeventhandler:libeventhandler_target", 116 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 117 "//base/startup/appspawn_standard:appspawn_socket_client", 118 "//foundation/aafwk/standard/interfaces/innerkits/base:base", 119 "//foundation/aafwk/standard/interfaces/innerkits/want:want", 120 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", 121 "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 122 "//utils/native/base:utils", 123 ] 124 125 external_deps = [ 126 "ces_standard:cesfwk_core", 127 "ces_standard:cesfwk_innerkits", 128 "hiviewdfx_hilog_native:libhilog", 129 "ipc:ipc_core", 130 ] 131 132 subsystem_name = "appexecfwk" 133 part_name = "appexecfwk_standard" 134} 135