1# 2# Copyright (c) 2024-2025 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16import("//build/ohos.gni") 17import("//foundation/ability/ability_runtime/ability_runtime.gni") 18 19group("ams_common_target") { 20 deps = [ 21 ":event_report", 22 ":perm_verification", 23 ":task_handler_wrap", 24 ] 25} 26 27config("common_config") { 28 visibility = [ ":*" ] 29 visibility += [ 30 "${ability_runtime_innerkits_path}/*", 31 "${ability_runtime_napi_path}/*", 32 "${ability_runtime_native_path}/ability/native/*", 33 "${ability_runtime_native_path}/child_process/*", 34 "${ability_runtime_path}/frameworks/c/ability_runtime/*", 35 "${ability_runtime_path}/frameworks/simulator/ability_simulator/*", 36 "${ability_runtime_path}/tools/aa/*", 37 "${ability_runtime_services_path}/common/*", 38 "${ability_runtime_services_path}/quickfixmgr/*", 39 "${ability_runtime_services_path}/uripermmgr/*", 40 "${ability_runtime_test_path}/*", 41 "${hiebpf_path}/*", 42 "${power_manager_path}/utils/*", 43 "${request_path}/common/*", 44 ] 45 include_dirs = [ 46 "include", 47 "${ability_runtime_innerkits_path}/ability_manager/include", 48 ] 49 cflags = [] 50 if (target_cpu == "arm") { 51 cflags += [ "-DBINDER_IPC_32BIT" ] 52 } 53} 54 55#build so 56ohos_shared_library("perm_verification") { 57 branch_protector_ret = "pac_ret" 58 59 include_dirs = [ "${ability_runtime_utils_path}/server/constant" ] 60 61 public_configs = [ ":common_config" ] 62 63 sources = [ "src/permission_verification.cpp" ] 64 65 deps = [ 66 ":record_cost_time_util", 67 ] 68 69 external_deps = [ 70 "ability_base:want", 71 "access_token:libaccesstoken_sdk", 72 "access_token:libtokenid_sdk", 73 "c_utils:utils", 74 "hilog:libhilog", 75 "hitrace:hitrace_meter", 76 "init:libbegetutil", 77 "ipc:ipc_core", 78 ] 79 80 cflags_cc = [] 81 if (os_dlp_part_enabled) { 82 cflags_cc += [ "-DWITH_DLP" ] 83 } 84 85 subsystem_name = "ability" 86 innerapi_tags = [ "platformsdk_indirect" ] 87 part_name = "ability_runtime" 88} 89 90ohos_shared_library("event_report") { 91 branch_protector_ret = "pac_ret" 92 93 public_configs = [ ":common_config" ] 94 95 defines = [] 96 if (current_cpu == "arm64") { 97 defines += [ "USE_EXTENSION_DATA" ] 98 } 99 100 sources = [ "src/event_report.cpp" ] 101 102 deps = [ 103 ":record_cost_time_util", 104 ] 105 106 external_deps = [ 107 "c_utils:utils", 108 "hilog:libhilog", 109 "hisysevent:libhisysevent", 110 "hitrace:hitrace_meter", 111 ] 112 113 innerapi_tags = [ "platformsdk_indirect" ] 114 subsystem_name = "ability" 115 part_name = "ability_runtime" 116} 117 118ohos_shared_library("task_handler_wrap") { 119 branch_protector_ret = "pac_ret" 120 121 public_configs = [ ":common_config" ] 122 include_dirs = [ "include" ] 123 124 sources = [ 125 "src/event_handler_wrap.cpp", 126 "src/ffrt_task_handler_wrap.cpp", 127 "src/queue_task_handler_wrap.cpp", 128 "src/task_handler_wrap.cpp", 129 ] 130 131 external_deps = [ 132 "ffrt:libffrt", 133 "hilog:libhilog", 134 ] 135 136 subsystem_name = "ability" 137 part_name = "ability_runtime" 138} 139 140ohos_shared_library("app_util") { 141 branch_protector_ret = "pac_ret" 142 143 public_configs = [ ":common_config" ] 144 include_dirs = [ "include" ] 145 146 sources = [ 147 "src/ability_manager_radar.cpp", 148 "src/ability_manager_xcollie.cpp", 149 "src/app_utils.cpp", 150 "src/json_utils.cpp", 151 ] 152 153 external_deps = [ 154 "c_utils:utils", 155 "config_policy:configpolicy_util", 156 "hicollie:libhicollie", 157 "hilog:libhilog", 158 "hisysevent:libhisysevent", 159 "init:libbeget_proxy", 160 "init:libbegetutil", 161 "json:nlohmann_json_static", 162 ] 163 164 if (ability_runtime_graphics) { 165 defines = [ "SUPPORT_GRAPHICS" ] 166 external_deps += [ "window_manager:libwsutils" ] 167 } 168 169 if (ability_runtime_media_library_enable) { 170 defines += [ "ABILITY_RUNTIME_MEDIA_LIBRARY_ENABLE" ] 171 } 172 173 subsystem_name = "ability" 174 part_name = "ability_runtime" 175} 176 177ohos_shared_library("res_sched_util") { 178 sanitize = { 179 integer_overflow = true 180 ubsan = true 181 boundary_sanitize = true 182 cfi = true 183 cfi_cross_dso = true 184 debug = false 185 } 186 branch_protector_ret = "pac_ret" 187 188 public_configs = [ ":common_config" ] 189 include_dirs = [ "include" ] 190 191 sources = [ "src/res_sched_util.cpp" ] 192 193 external_deps = [ 194 "bundle_framework:appexecfwk_base", 195 "c_utils:utils", 196 "hilog:libhilog", 197 "ipc:ipc_core", 198 "ipc:ipc_single", 199 "samgr:samgr_proxy", 200 ] 201 202 if (resource_schedule_service_enable) { 203 defines = [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 204 external_deps += [ "resource_schedule_service:ressched_client" ] 205 } 206 207 subsystem_name = "ability" 208 part_name = "ability_runtime" 209} 210 211ohos_shared_library("record_cost_time_util") { 212 sanitize = { 213 integer_overflow = true 214 ubsan = true 215 boundary_sanitize = true 216 cfi = true 217 cfi_cross_dso = true 218 debug = false 219 } 220 branch_protector_ret = "pac_ret" 221 222 include_dirs = [ "include" ] 223 224 public_configs = [ ":common_config" ] 225 226 sources = [ "src/record_cost_time_util.cpp" ] 227 228 external_deps = [ 229 "c_utils:utils", 230 "hilog:libhilog", 231 ] 232 233 innerapi_tags = [ "platformsdk_indirect" ] 234 subsystem_name = "ability" 235 part_name = "ability_runtime" 236} 237 238ohos_shared_library("rate_limiter") { 239 sanitize = { 240 integer_overflow = true 241 ubsan = true 242 boundary_sanitize = true 243 cfi = true 244 cfi_cross_dso = true 245 debug = false 246 } 247 branch_protector_ret = "pac_ret" 248 249 include_dirs = [ "include" ] 250 251 public_configs = [ ":common_config" ] 252 253 sources = [ "src/rate_limiter.cpp" ] 254 255 external_deps = [ 256 "c_utils:utils", 257 "hilog:libhilog", 258 ] 259 260 innerapi_tags = [ "platformsdk_indirect" ] 261 subsystem_name = "ability" 262 part_name = "ability_runtime" 263} 264 265ohos_shared_library("hitrace_chain_util") { 266 sanitize = { 267 integer_overflow = true 268 ubsan = true 269 boundary_sanitize = true 270 cfi = true 271 cfi_cross_dso = true 272 debug = false 273 } 274 branch_protector_ret = "pac_ret" 275 276 include_dirs = [ "include" ] 277 278 public_configs = [ ":common_config" ] 279 280 sources = [ "src/hitrace_chain_utils.cpp" ] 281 282 external_deps = [ 283 "c_utils:utils", 284 "hitrace:libhitracechain", 285 ] 286 287 innerapi_tags = [ "platformsdk_indirect" ] 288 subsystem_name = "ability" 289 part_name = "ability_runtime" 290}