1# Copyright (c) 2022-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("//build/ohos.gni") 15import("../../ressched/ressched.gni") 16import("../cgroup_sched.gni") 17 18config("cgroup_sched_public_config") { 19 include_dirs = [ 20 "../interfaces/innerkits/include", 21 "sched_controller/include", 22 "process_group/include", 23 ] 24} 25 26config("cgroup_sched_private_config") { 27 include_dirs = [ 28 "../../ressched/interfaces/innerkits/ressched_client/include", 29 "../common/include", 30 "./utils/include", 31 "${ressched_common}/include", 32 ] 33} 34 35ohos_shared_library("cgroup_sched") { 36 public_configs = [ ":cgroup_sched_public_config" ] 37 38 configs = [ ":cgroup_sched_private_config" ] 39 40 sources = [ 41 "${cgroup_sched_common}/cgroup_sched_log.cpp", 42 "sched_controller/app_state_observer.cpp", 43 "sched_controller/cgroup_adjuster.cpp", 44 "sched_controller/cgroup_event_handler.cpp", 45 "sched_controller/sched_controller.cpp", 46 "sched_controller/supervisor.cpp", 47 "sched_controller/window_state_observer.cpp", 48 "utils/ressched_utils.cpp", 49 ] 50 51 deps = [ "./process_group:libprocess_group" ] 52 53 external_deps = [ 54 "ability_runtime:app_manager", 55 "ability_runtime:wantagent_innerkits", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "eventhandler:libeventhandler", 60 "hilog:libhilog", 61 "hisysevent:libhisysevent", 62 "hitrace:hitrace_meter", 63 "ipc:ipc_single", 64 "samgr:samgr_proxy", 65 "window_manager:libwm", 66 ] 67 68 if (has_bg_task_mgr) { 69 defines = [ "CONFIG_BGTASK_MGR" ] 70 sources += [ "sched_controller/background_task_observer.cpp" ] 71 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 72 } 73 74 if (ressched_power_manager_enable) { 75 external_deps += [ "power_manager:powermgr_client" ] 76 defines += [ "POWER_MANAGER_ENABLE" ] 77 } 78 79 sanitize = { 80 cfi = true 81 cfi_cross_dso = true 82 debug = false 83 } 84 branch_protector_ret = "pac_ret" 85 86 part_name = "resource_schedule_service" 87 subsystem_name = "resourceschedule" 88} 89