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