1# 2# Copyright (c) 2024 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 external_deps = [ 66 "ability_base:want", 67 "access_token:libaccesstoken_sdk", 68 "access_token:libtokenid_sdk", 69 "c_utils:utils", 70 "hilog:libhilog", 71 "hitrace:hitrace_meter", 72 "init:libbegetutil", 73 "ipc:ipc_core", 74 ] 75 76 cflags_cc = [] 77 if (os_dlp_part_enabled) { 78 cflags_cc += [ "-DWITH_DLP" ] 79 } 80 81 subsystem_name = "ability" 82 innerapi_tags = [ "platformsdk_indirect" ] 83 part_name = "ability_runtime" 84} 85 86ohos_shared_library("event_report") { 87 branch_protector_ret = "pac_ret" 88 89 public_configs = [ ":common_config" ] 90 91 sources = [ "src/event_report.cpp" ] 92 93 external_deps = [ 94 "c_utils:utils", 95 "hilog:libhilog", 96 "hisysevent:libhisysevent", 97 "hitrace:hitrace_meter", 98 ] 99 100 innerapi_tags = [ "platformsdk_indirect" ] 101 subsystem_name = "ability" 102 part_name = "ability_runtime" 103} 104 105ohos_shared_library("task_handler_wrap") { 106 branch_protector_ret = "pac_ret" 107 108 public_configs = [ ":common_config" ] 109 include_dirs = [ "include" ] 110 111 sources = [ 112 "src/event_handler_wrap.cpp", 113 "src/ffrt_task_handler_wrap.cpp", 114 "src/queue_task_handler_wrap.cpp", 115 "src/task_handler_wrap.cpp", 116 ] 117 118 external_deps = [ 119 "ffrt:libffrt", 120 "hilog:libhilog", 121 ] 122 123 subsystem_name = "ability" 124 part_name = "ability_runtime" 125} 126 127ohos_shared_library("app_util") { 128 branch_protector_ret = "pac_ret" 129 130 public_configs = [ ":common_config" ] 131 include_dirs = [ "include" ] 132 133 sources = [ 134 "src/ability_manager_radar.cpp", 135 "src/app_utils.cpp", 136 "src/json_utils.cpp", 137 ] 138 139 external_deps = [ 140 "c_utils:utils", 141 "config_policy:configpolicy_util", 142 "hilog:libhilog", 143 "hisysevent:libhisysevent", 144 "init:libbegetutil", 145 "json:nlohmann_json_static", 146 ] 147 148 if (ability_runtime_graphics) { 149 defines = [ "SUPPORT_GRAPHICS" ] 150 external_deps += [ "window_manager:libwsutils" ] 151 } 152 153 subsystem_name = "ability" 154 part_name = "ability_runtime" 155} 156 157ohos_shared_library("res_sched_util") { 158 sanitize = { 159 integer_overflow = true 160 ubsan = true 161 boundary_sanitize = true 162 cfi = true 163 cfi_cross_dso = true 164 debug = false 165 } 166 branch_protector_ret = "pac_ret" 167 168 public_configs = [ ":common_config" ] 169 include_dirs = [ "include" ] 170 171 sources = [ "src/res_sched_util.cpp" ] 172 173 external_deps = [ 174 "bundle_framework:appexecfwk_base", 175 "c_utils:utils", 176 "hilog:libhilog", 177 "ipc:ipc_core", 178 "samgr:samgr_proxy", 179 ] 180 181 if (resource_schedule_service_enable) { 182 defines = [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 183 external_deps += [ "resource_schedule_service:ressched_client" ] 184 } 185 186 subsystem_name = "ability" 187 part_name = "ability_runtime" 188} 189