• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
13import("//build/ohos.gni")
14import("../../power.gni")
15
16ohos_shared_library("libpower_interface_service_1.2") {
17  include_dirs = [ "../../utils/include" ]
18  sources = [
19    "../../utils/power_xcollie.cpp",
20    "src/power_config.cpp",
21    "src/power_interface_impl.cpp",
22    "src/running_lock_counter.cpp",
23    "src/running_lock_impl.cpp",
24    "src/running_lock_timer_handler.cpp",
25    "src/system_operation.cpp",
26  ]
27
28  external_deps = [
29    "drivers_interface_power:libpower_stub_1.2",
30    "hdf_core:libhdf_host",
31    "hdf_core:libhdf_utils",
32    "hilog:libhilog",
33    "ipc:ipc_single",
34    "jsoncpp:jsoncpp",
35    "libxml2:libxml2",
36  ]
37
38  defines = []
39  if (drivers_peripheral_power_c_utils) {
40    external_deps += [ "c_utils:utils" ]
41  }
42
43  # xcollie has a bug, disable it
44  if (drivers_peripheral_power_hicollie) {
45    external_deps += [ "hicollie:libhicollie" ]
46    defines += [ "HICOLLIE_ENABLE" ]
47  }
48
49  if (drivers_peripheral_power_config_policy) {
50    external_deps += [ "config_policy:configpolicy_util" ]
51  }
52
53  if (drivers_peripheral_power_wakeup_cause_path) {
54    defines += [ "DRIVER_PERIPHERAL_POWER_WAKEUP_CAUSE_PATH" ]
55  }
56
57  if (drivers_peripheral_power_suspend_with_tag) {
58    defines += [ "DRIVER_PERIPHERAL_POWER_SUSPEND_WITH_TAG" ]
59  }
60
61  if (drivers_peripheral_power_faster_retry_of_sleep) {
62    defines += [ "FASTER_RETRY_OF_SLEEP" ]
63  }
64
65  if (drivers_peripheral_power_enable_s4) {
66    sources += [ "src/hibernate.cpp" ]
67    defines += [ "DRIVERS_PERIPHERAL_POWER_ENABLE_S4" ]
68  }
69
70  if (drivers_peripheral_power_slower_retry_of_sleep) {
71    defines += [ "SLOWER_RETRY_OF_SLEEP" ]
72  }
73
74  if (drivers_peripheral_power_host_sched_priority) {
75    defines += [ "DRIVERS_PERIPHERAL_POWER_HOST_SCHED_PRIORITY" ]
76  }
77
78  install_images = [ chipset_base_dir ]
79  subsystem_name = "hdf"
80  part_name = "drivers_peripheral_power"
81}
82
83##############################################################################################
84
85ohos_shared_library("libpower_driver") {
86  sources = [ "src/power_interface_driver.cpp" ]
87
88  external_deps = [
89    "drivers_interface_power:libpower_stub_1.2",
90    "hdf_core:libhdf_host",
91    "hdf_core:libhdf_ipc_adapter",
92    "hdf_core:libhdf_utils",
93    "hdf_core:libhdi",
94    "hilog:libhilog",
95    "ipc:ipc_single",
96  ]
97  if (drivers_peripheral_power_c_utils) {
98    external_deps += [ "c_utils:utils" ]
99  }
100
101  shlib_type = "hdi"
102  install_images = [ chipset_base_dir ]
103  subsystem_name = "hdf"
104  part_name = "drivers_peripheral_power"
105}
106
107group("hdf_power") {
108  deps = [
109    ":libpower_driver",
110    ":libpower_interface_service_1.2",
111  ]
112
113  if (drivers_peripheral_power_wakeup_cause_path) {
114    deps += [ "profile:power_hdi_service_config" ]
115  }
116}
117