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