• 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  cflags_cc = [
39    "-fstack-protector-strong",
40  ]
41  sources = StandbyUtilsPolicy
42
43  public_configs = [ ":standby_utils_policy_config" ]
44
45  deps = [ "${standby_utils_common_path}:standby_utils_common" ]
46
47  external_deps = StandbyUtilsPolicyExternalDeps
48
49  public_external_deps = [ "json:nlohmann_json_static" ]
50
51  defines = []
52  if (enable_standby_configpolicy) {
53    external_deps += [ "config_policy:configpolicy_util" ]
54    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
55  }
56
57  subsystem_name = "resourceschedule"
58  part_name = "${standby_service_part_name}"
59  version_script = "libstandby_utils_policy.versionscript"
60}
61
62ohos_static_library("standby_utils_policy_static") {
63  branch_protector_ret = "pac_ret"
64  sanitize = {
65    cfi = true
66    cfi_cross_dso = true
67    debug = false
68  }
69  sources = StandbyUtilsPolicy
70
71  public_configs = [ ":standby_utils_policy_config" ]
72
73  deps = [ "${standby_utils_common_path}:standby_utils_common" ]
74
75  external_deps = StandbyUtilsPolicyExternalDeps
76
77  public_external_deps = [ "json:nlohmann_json_static" ]
78
79  defines = []
80  if (enable_standby_configpolicy) {
81    external_deps += [ "config_policy:configpolicy_util" ]
82    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
83  }
84
85  subsystem_name = "resourceschedule"
86  part_name = "${standby_service_part_name}"
87}
88
89ohos_prebuilt_etc("stancby_service_policy_config_device_standby") {
90  source = "configs/device_standby_config.json"
91  install_enable = true
92  subsystem_name = "resourceschedule"
93  part_name = "${standby_service_part_name}"
94  module_install_dir = "etc/standby_service"
95}
96
97ohos_prebuilt_etc("stancby_service_policy_config_resource_config") {
98  source = "configs/standby_strategy_config.json"
99  install_enable = true
100  subsystem_name = "resourceschedule"
101  part_name = "${standby_service_part_name}"
102  module_install_dir = "etc/standby_service"
103}
104
105group("standby_service_config") {
106  deps = [
107    ":stancby_service_policy_config_device_standby",
108    ":stancby_service_policy_config_resource_config",
109  ]
110}
111