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("../../../../hdf_core/adapter/uhdf2/uhdf.gni") 15 16ohos_shared_library("libbattery_interface_service_2.0") { 17 include_dirs = [ 18 "include", 19 "../include", 20 "../../utils/include", 21 ] 22 sources = [ 23 "src/battery_config.cpp", 24 "src/battery_interface_impl.cpp", 25 "src/battery_thread.cpp", 26 "src/power_supply_provider.cpp", 27 ] 28 deps = [ "//third_party/jsoncpp:jsoncpp" ] 29 30 if (is_standard_system) { 31 external_deps = [ 32 "c_utils:utils", 33 "config_policy:configpolicy_util", 34 "drivers_interface_battery:battery_idl_headers", 35 "drivers_interface_light:liblight_proxy_1.0", 36 "hdf_core:libpub_utils", 37 "hilog:libhilog", 38 "ipc:ipc_single", 39 ] 40 } else { 41 external_deps = [ 42 "hilog:libhilog", 43 "ipc:ipc_single", 44 ] 45 } 46 47 install_images = [ chipset_base_dir ] 48 subsystem_name = "hdf" 49 part_name = "drivers_peripheral_battery" 50} 51 52############################################################################################## 53 54ohos_shared_library("libbattery_driver") { 55 include_dirs = [ 56 "include", 57 "../include", 58 "../../utils/include", 59 "../../charger/led", 60 ] 61 sources = [ "src/battery_interface_driver.cpp" ] 62 63 deps = [ "//third_party/jsoncpp:jsoncpp" ] 64 65 if (is_standard_system) { 66 external_deps = [ 67 "c_utils:utils", 68 "drivers_interface_battery:libbattery_stub_2.0", 69 "hdf_core:libhdf_host", 70 "hdf_core:libhdf_ipc_adapter", 71 "hdf_core:libhdf_utils", 72 "hdf_core:libhdi", 73 "hilog:libhilog", 74 "ipc:ipc_single", 75 ] 76 } else { 77 external_deps = [ 78 "hilog:libhilog", 79 "ipc:ipc_single", 80 ] 81 } 82 83 shlib_type = "hdi" 84 install_images = [ chipset_base_dir ] 85 subsystem_name = "hdf" 86 part_name = "drivers_peripheral_battery" 87} 88 89group("hdf_battery") { 90 deps = [ 91 ":libbattery_driver", 92 ":libbattery_interface_service_2.0", 93 "profile:battery_config", 94 ] 95} 96