1# Copyright (c) 2021-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("../../../../../powermgr.gni")
15import("../actions.gni")
16
17config("powermgr_actions_impl_public_config") {
18  include_dirs = [ "." ]
19}
20
21config("powermgr_display_actions_impl_public_config") {
22  include_dirs = [ "./display" ]
23}
24
25config("powermgr_actions_common_config") {
26  include_dirs = [
27    "${powermgr_inner_api}/native/include",
28    "${powermgr_service_path}/native/include",
29  ]
30}
31
32ohos_source_set("${powermgr_actions_default_target}") {
33  sanitize = {
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37  }
38  branch_protector_ret = "pac_ret"
39
40  sources = [
41    "device_power_action.cpp",
42    "running_lock_action.cpp",
43    "suspend/running_lock_hub.cpp",
44    "suspend/suspend_controller.cpp",
45    "system_suspend_controller.cpp",
46  ]
47
48  configs = [
49    ":powermgr_actions_common_config",
50    "${powermgr_utils_path}:utils_config",
51    "${powermgr_utils_path}:coverage_flags",
52  ]
53
54  public_configs = [ ":powermgr_actions_impl_public_config" ]
55
56  deps = [
57    "${powermgr_utils_path}/ffrt:power_ffrt",
58    "${powermgr_utils_path}/intf_wrapper:power_intf_wrapper",
59    "${powermgr_utils_path}/lib_loader:power_lib_loader",
60  ]
61
62  external_deps = [
63    "c_utils:utils",
64    "drivers_interface_power:libpower_proxy_1.2",
65    "ffrt:libffrt",
66    "hdf_core:libhdf_utils",
67    "hdf_core:libhdi",
68    "hdf_core:libpub_utils",
69    "hilog:libhilog",
70    "image_framework:image_native",
71    "init:libbegetutil",
72    "ipc:ipc_core",
73  ]
74
75  if (has_display_manager_part) {
76    sources += [ "display/device_state_action.cpp" ]
77    public_configs += [ ":powermgr_display_actions_impl_public_config" ]
78    external_deps += [
79      "display_manager:displaymgr",
80      "window_manager:libdm_lite",
81    ]
82  } else {
83    sources += [ "display/default_device_state_action.cpp" ]
84  }
85
86  subsystem_name = "powermgr"
87  part_name = "${powermgr_part_name}"
88}
89