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("//base/account/os_account/os_account.gni") 15import("//build/ohos.gni") 16import("//foundation/ability/ability_runtime/ability_runtime.gni") 17import( 18 "//foundation/ability/ability_runtime/services/abilitymgr/abilitymgr.gni") 19import("//foundation/distributeddatamgr/relational_store/relational_store.gni") 20import("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") 21 22group("abilityms_target") { 23 deps = [ 24 ":abilityms", 25 ":ams_service_config", 26 ] 27} 28 29config("abilityms_exception_config") { 30 cflags_cc = [ "-fexceptions" ] 31} 32 33config("abilityms_config") { 34 include_dirs = [ 35 "include/", 36 "${ability_runtime_innerkits_path}/ability_manager/include", 37 "${ability_runtime_innerkits_path}/app_manager/include", 38 "${ability_runtime_innerkits_path}/connectionobs_manager/include", 39 "${ability_runtime_innerkits_path}/deps_wrapper/include", 40 "${ability_base_path}/interfaces/inner_api/base/include", 41 "${ability_base_kits_path}/extractortool/include", 42 "${ability_base_kits_path}/uri/include", 43 "${ability_base_kits_path}/want/include", 44 "${ability_runtime_services_path}/common/include", 45 "//prebuilts/jdk/jdk8/linux-x86/include", 46 "//prebuilts/jdk/jdk8/linux-x86/include/linux", 47 "//third_party/json/include", 48 "${ability_runtime_path}/interfaces/kits/native/ability/native", 49 "${relational_store_innerapi_path}/rdb/include", 50 "${relational_store_innerapi_path}/appdatafwk/include", 51 "${relational_store_innerapi_path}/dataability/include", 52 "${ability_runtime_innerkits_path}/dataobs_manager/include", 53 "${ability_runtime_path}/tools/aa/include", 54 "${os_account_path}/frameworks/common/account_error/include", 55 "${os_account_path}/frameworks/common/database/include", 56 "${os_account_path}/interfaces/innerkits/osaccount/native/include", 57 "${ability_runtime_innerkits_path}/wantagent/include", 58 "${ability_runtime_innerkits_path}/session_handler/include", 59 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", 60 "${bgtaskmgr_interfaces_path}/innerkits/include", 61 "${bgtaskmgr_frameworks_path}/common/include", 62 "${bgtaskmgr_frameworks_path}/include", 63 "${init_path}/interfaces/innerkits/include/syspara/", 64 "${bundlefwk_inner_api_path}/appexecfwk_core/include", 65 ] 66 67 defines = [] 68 69 if (is_asan) { 70 defines += [ "SUPPORT_ASAN" ] 71 } 72 73 if (ability_command_for_test) { 74 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 75 } 76 77 if (ability_fault_and_exit_test) { 78 defines += [ "ABILITY_FAULT_AND_EXIT_TEST" ] 79 } 80 81 if (ability_runtime_graphics) { 82 include_dirs += [ 83 "${graphic_path}/interfaces/inner_api", 84 "${multimedia_path}/interfaces/innerkits/include", 85 "${graphic_path}/interfaces/inner_api/wmservice", 86 "${global_path}/i18n/frameworks/intl/include", 87 ] 88 89 defines += [ "SUPPORT_GRAPHICS" ] 90 } 91 92 if (background_task_mgr_continuous_task_enable) { 93 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 94 } 95 96 if (resource_schedule_service_enable) { 97 defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 98 } 99 100 if (efficiency_manager) { 101 defines += [ "EFFICIENCY_MANAGER_ENABLE" ] 102 } 103 104 if (is_asan) { 105 defines += [ "SUPPORT_ASAN" ] 106 } 107 108 if (ecologic_rule_enabled) { 109 defines += [ "SUPPORT_ERMS" ] 110 } 111 112 cflags = [] 113 if (target_cpu == "arm") { 114 cflags += [ "-DBINDER_IPC_32BIT" ] 115 } 116} 117 118ohos_shared_library("abilityms") { 119 shlib_type = "sa" 120 sources = abilityms_files 121 cflags_cc = [] 122 configs = [ 123 ":abilityms_config", 124 ":abilityms_exception_config", 125 ] 126 deps = [ 127 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 128 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 129 "${ability_runtime_innerkits_path}/ability_manager:mission_info", 130 "${ability_runtime_innerkits_path}/app_manager:app_manager", 131 "${ability_runtime_innerkits_path}/connectionobs_manager:connection_obs_manager", 132 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 133 "${ability_runtime_innerkits_path}/session_handler:session_handler", 134 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 135 "${ability_runtime_native_path}/ability/native:abilitykit_native", 136 "${ability_runtime_services_path}/common:event_report", 137 "${ability_runtime_services_path}/common:perm_verification", 138 "${ability_runtime_services_path}/common:task_handler_wrap", 139 "//third_party/icu/icu4c:shared_icuuc", 140 ] 141 142 external_deps = [ 143 "ability_base:base", 144 "ability_base:configuration", 145 "ability_base:session_info", 146 "ability_base:want", 147 "ability_base:zuri", 148 "access_token:libaccesstoken_sdk", 149 "bundle_framework:appexecfwk_base", 150 "bundle_framework:appexecfwk_core", 151 "c_utils:utils", 152 "common_event_service:cesfwk_core", 153 "common_event_service:cesfwk_innerkits", 154 "dsoftbus:softbus_client", 155 "ffrt:libffrt", 156 "hicollie:libhicollie", 157 "hilog:libhilog", 158 "hisysevent:libhisysevent", 159 "hitrace:hitrace_meter", 160 "init:libbeget_proxy", 161 "init:libbegetutil", 162 "ipc:ipc_core", 163 "kv_store:distributeddata_inner", 164 "relational_store:native_dataability", 165 "relational_store:native_rdb", 166 "safwk:system_ability_fwk", 167 "samgr:samgr_proxy", 168 "window_manager:libwsutils", 169 "window_manager:scene_session", 170 "window_manager:sms", 171 ] 172 173 if (background_task_mgr_continuous_task_enable) { 174 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 175 } 176 177 if (resource_schedule_service_enable) { 178 external_deps += [ "resource_schedule_service:ressched_client" ] 179 } 180 181 if (efficiency_manager) { 182 external_deps += [ "efficiency_manager:suspend_manager_client" ] 183 } 184 185 if (os_dlp_part_enabled) { 186 cflags_cc += [ "-DWITH_DLP" ] 187 external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ] 188 } 189 190 if (ability_runtime_graphics) { 191 deps += [ 192 "//third_party/icu/icu4c:shared_icuuc", 193 "//third_party/libjpeg-turbo:turbojpeg_static", 194 ] 195 196 external_deps += [ 197 "ability_base:session_info", 198 "i18n:intl_util", 199 "image_framework:image_native", 200 "input:libmmi-client", 201 "resource_management:global_resmgr", 202 "window_manager:libdm", 203 "window_manager:libwm", 204 ] 205 } 206 207 if (ecologic_rule_enabled) { 208 external_deps += [ "ecological_rule_mgr:erms_client" ] 209 } 210 211 version_script = "libabilityms.map" 212 subsystem_name = "ability" 213 innerapi_tags = [ "platformsdk_indirect" ] 214 part_name = "ability_runtime" 215} 216 217ohos_prebuilt_etc("ams_service_config.json") { 218 source = "resource/ams_service_config.json" 219 subsystem_name = "ability" 220 part_name = "ability_runtime" 221} 222 223group("ams_service_config") { 224 deps = [ ":ams_service_config.json" ] 225} 226