1# Copyright (c) 2022 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("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 15 16ohos_shared_library("libbattery_interface_service_1.1") { 17 include_dirs = [ 18 "include", 19 "../include", 20 "../../utils/include", 21 "//drivers/peripheral/battery/charger/led", 22 ] 23 sources = [ 24 "//drivers/peripheral/battery/charger/led/battery_led.cpp", 25 "src/battery_config.cpp", 26 "src/battery_interface_impl.cpp", 27 "src/battery_thread.cpp", 28 "src/power_supply_provider.cpp", 29 ] 30 deps = [ "//third_party/jsoncpp:jsoncpp" ] 31 32 if (is_standard_system) { 33 external_deps = [ 34 "c_utils:utils", 35 "drivers_interface_battery:battery_idl_headers", 36 "drivers_interface_light:liblight_proxy_1.0", 37 "hiviewdfx_hilog_native: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 "//drivers/peripheral/battery/charger/led", 60 ] 61 sources = [ "src/battery_interface_driver.cpp" ] 62 63 deps = [ 64 "//drivers/interface/battery/v1_1:libbattery_stub_1.1", 65 "//third_party/jsoncpp:jsoncpp", 66 ] 67 68 if (is_standard_system) { 69 external_deps = [ 70 "c_utils:utils", 71 "hdf_core:libhdf_host", 72 "hdf_core:libhdf_ipc_adapter", 73 "hdf_core:libhdi", 74 "hiviewdfx_hilog_native:libhilog", 75 "ipc:ipc_single", 76 ] 77 } else { 78 external_deps = [ 79 "hilog:libhilog", 80 "ipc:ipc_single", 81 ] 82 } 83 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_1.1", 93 ] 94} 95