1# Copyright (c) 2022-2025 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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("//build/test.gni") 17import("../../../ressched.gni") 18 19idl_gen_interface("res_sched_event_listener_interface") { 20 src_idl = rebase_path("IResSchedEventListener.idl") 21} 22 23idl_gen_interface("res_sched_service_interface") { 24 src_idl = rebase_path("IResSchedService.idl") 25} 26 27idl_gen_interface("res_sched_systemload_notifier_interface") { 28 src_idl = rebase_path("IResSchedSystemloadNotifier.idl") 29} 30 31idl_gen_interface("suspend_observer_base_interface") { 32 sources = [ 33 "../suspend_manager_base_client/src/ISuspendStateObserverBase.idl", 34 ] 35} 36 37config("client_private_config") { 38 include_dirs = [ "${ressched_common}/include" ] 39} 40 41config("client_public_config") { 42 include_dirs = [ 43 "include", 44 "../suspend_manager_base_client/include", 45 "${target_gen_dir}", 46 ] 47} 48 49ohos_source_set("res_sched_service_stub") { 50 sanitize = { 51 cfi = true 52 cfi_cross_dso = true 53 debug = false 54 } 55 output_values = get_target_outputs(":res_sched_service_interface") 56 sources = filter_include(output_values, [ "*_stub.cpp" ]) 57 public_configs = [] 58 deps = [ 59 ":res_sched_service_interface", 60 ":suspend_observer_base_interface", 61 ] 62 subsystem_name = "resourceschedule" 63 part_name = "resource_schedule_service" 64 external_deps = [ 65 "c_utils:utils", 66 "ipc:ipc_core", 67 "hilog:libhilog", 68 ] 69 branch_protector_ret = "pac_ret" 70} 71 72config("suspend_manager_base_client_public_config") { 73 include_dirs = [ 74 "include", 75 "../suspend_manager_base_client/include", 76 "${target_gen_dir}", 77 ] 78} 79 80ohos_source_set("suspend_manager_base_client") { 81 sanitize = { 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 } 86 deps = [ 87 ":suspend_observer_base_interface", 88 ] 89 90 sources = [ 91 "../suspend_manager_base_client/src/suspend_manager_base_client.cpp", 92 ] 93 94 output_observer_values = get_target_outputs(":suspend_observer_base_interface") 95 sources += filter_include(output_observer_values, [ "*suspend_state_observer_base_proxy.cpp" ]) 96 sources += filter_include(output_observer_values, [ "*suspend_state_observer_base_stub.cpp" ]) 97 98 public_configs = [ ":suspend_manager_base_client_public_config" ] 99 100 external_deps = [ 101 "hilog:libhilog", 102 "init:libbegetutil", 103 "init:libbeget_proxy", 104 "ipc:ipc_core", 105 "ipc:ipc_single", 106 "samgr:samgr_proxy", 107 "json:nlohmann_json_static", 108 ] 109 110 branch_protector_ret = "pac_ret" 111 112 subsystem_name = "resourceschedule" 113 part_name = "resource_schedule_service" 114} 115 116ohos_shared_library("ressched_client") { 117 configs = [ ":client_private_config" ] 118 cflags_cc = [ "-fstack-protector-strong" ] 119 public_configs = [ ":client_public_config" ] 120 121 deps = [ 122 ":res_sched_event_listener_interface", 123 ":res_sched_service_interface", 124 ":res_sched_systemload_notifier_interface", 125 ":suspend_manager_base_client", 126 ] 127 128 sources = [ 129 "src/res_sa_init.cpp", 130 "src/res_sched_client.cpp", 131 "src/res_sched_common_death_recipient.cpp", 132 ] 133 134 output_values = get_target_outputs(":res_sched_service_interface") 135 sources += filter_include(output_values, [ "*.cpp" ]) 136 137 event_listener_output_values = 138 get_target_outputs(":res_sched_event_listener_interface") 139 sources += filter_include(event_listener_output_values, [ "*.cpp" ]) 140 141 systemload_notifier_output_values = 142 get_target_outputs(":res_sched_systemload_notifier_interface") 143 sources += filter_include(systemload_notifier_output_values, [ "*.cpp" ]) 144 145 external_deps = [ 146 "c_utils:utils", 147 "ffrt:libffrt", 148 "hilog:libhilog", 149 "hitrace:hitrace_meter", 150 "samgr:samgr_proxy", 151 ] 152 153 public_external_deps = [ 154 "json:nlohmann_json_static", 155 "ipc:ipc_core", 156 "ipc:ipc_single", 157 ] 158 159 install_images = [ 160 system_base_dir, 161 updater_base_dir, 162 ] 163 164 innerapi_tags = [ 165 "chipsetsdk_sp_indirect", 166 "platformsdk", 167 ] 168 version_script = "libressched_client.versionscript" 169 170 sanitize = { 171 cfi = true 172 cfi_cross_dso = true 173 debug = false 174 } 175 branch_protector_ret = "pac_ret" 176 177 subsystem_name = "resourceschedule" 178 part_name = "resource_schedule_service" 179} 180