• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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("//foundation/resourceschedule/device_standby/standby_service.gni")
15
16config("standby_utils_policy_config") {
17  include_dirs = [ "include" ]
18}
19
20StandbyUtilsPolicy = [
21  "src/json_utils.cpp",
22  "src/standby_config_manager.cpp",
23]
24
25StandbyUtilsPolicyExternalDeps = [
26  "c_utils:utils",
27  "hilog:libhilog",
28  "ipc:ipc_single",
29]
30
31ohos_shared_library("standby_utils_policy") {
32  branch_protector_ret = "pac_ret"
33  sanitize = {
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37  }
38  sources = StandbyUtilsPolicy
39
40  public_configs = [ ":standby_utils_policy_config" ]
41
42  deps = [ "${standby_utils_common_path}:standby_utils_common" ]
43
44  external_deps = StandbyUtilsPolicyExternalDeps
45
46  public_external_deps = [ "json:nlohmann_json_static" ]
47
48  defines = []
49  if (enable_standby_configpolicy) {
50    external_deps += [ "config_policy:configpolicy_util" ]
51    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
52  }
53
54  subsystem_name = "resourceschedule"
55  part_name = "${standby_service_part_name}"
56  version_script = "libstandby_utils_policy.versionscript"
57}
58
59ohos_static_library("standby_utils_policy_static") {
60  branch_protector_ret = "pac_ret"
61  sanitize = {
62    cfi = true
63    cfi_cross_dso = true
64    debug = false
65  }
66  sources = StandbyUtilsPolicy
67
68  public_configs = [ ":standby_utils_policy_config" ]
69
70  deps = [ "${standby_utils_common_path}:standby_utils_common" ]
71
72  external_deps = StandbyUtilsPolicyExternalDeps
73
74  public_external_deps = [ "json:nlohmann_json_static" ]
75
76  defines = []
77  if (enable_standby_configpolicy) {
78    external_deps += [ "config_policy:configpolicy_util" ]
79    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
80  }
81
82  subsystem_name = "resourceschedule"
83  part_name = "${standby_service_part_name}"
84}
85
86ohos_prebuilt_etc("stancby_service_policy_config_device_standby") {
87  source = "configs/device_standby_config.json"
88  install_enable = true
89  subsystem_name = "resourceschedule"
90  part_name = "${standby_service_part_name}"
91  module_install_dir = "etc/standby_service"
92}
93
94ohos_prebuilt_etc("stancby_service_policy_config_resource_config") {
95  source = "configs/standby_strategy_config.json"
96  install_enable = true
97  subsystem_name = "resourceschedule"
98  part_name = "${standby_service_part_name}"
99  module_install_dir = "etc/standby_service"
100}
101
102group("standby_service_config") {
103  deps = [
104    ":stancby_service_policy_config_device_standby",
105    ":stancby_service_policy_config_resource_config",
106  ]
107}
108