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 "hilog:libhilog", 95 "hisysevent:libhisysevent", 96 "hitrace:hitrace_meter", 97 ] 98 99 innerapi_tags = [ "platformsdk_indirect" ] 100 subsystem_name = "ability" 101 part_name = "ability_runtime" 102} 103 104ohos_shared_library("task_handler_wrap") { 105 branch_protector_ret = "pac_ret" 106 107 public_configs = [ ":common_config" ] 108 include_dirs = [ "include" ] 109 110 sources = [ 111 "src/event_handler_wrap.cpp", 112 "src/ffrt_task_handler_wrap.cpp", 113 "src/queue_task_handler_wrap.cpp", 114 "src/task_handler_wrap.cpp", 115 ] 116 117 external_deps = [ 118 "ffrt:libffrt", 119 "hilog:libhilog", 120 ] 121 122 subsystem_name = "ability" 123 part_name = "ability_runtime" 124} 125 126ohos_shared_library("app_util") { 127 branch_protector_ret = "pac_ret" 128 129 public_configs = [ ":common_config" ] 130 include_dirs = [ "include" ] 131 132 sources = [ 133 "src/ability_manager_radar.cpp", 134 "src/app_utils.cpp", 135 "src/json_utils.cpp", 136 ] 137 138 external_deps = [ 139 "config_policy:configpolicy_util", 140 "hilog:libhilog", 141 "hisysevent:libhisysevent", 142 "init:libbegetutil", 143 "json:nlohmann_json_static", 144 "window_manager:libwsutils", 145 ] 146 147 subsystem_name = "ability" 148 part_name = "ability_runtime" 149} 150 151ohos_shared_library("res_sched_util") { 152 sanitize = { 153 integer_overflow = true 154 ubsan = true 155 boundary_sanitize = true 156 cfi = true 157 cfi_cross_dso = true 158 debug = false 159 } 160 branch_protector_ret = "pac_ret" 161 162 public_configs = [ ":common_config" ] 163 include_dirs = [ "include" ] 164 165 sources = [ "src/res_sched_util.cpp" ] 166 167 external_deps = [ 168 "bundle_framework:appexecfwk_base", 169 "hilog:libhilog", 170 ] 171 172 if (resource_schedule_service_enable) { 173 defines = [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 174 external_deps += [ "resource_schedule_service:ressched_client" ] 175 } 176 177 subsystem_name = "ability" 178 part_name = "ability_runtime" 179} 180