1# Copyright (c) 2021-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.
13
14import("../../batterymgr.gni")
15
16config("batterynapi_private_config") {
17  include_dirs = [ "include" ]
18}
19
20ohos_shared_library("batteryinfo") {
21  sources = [
22    "src/battery_info.cpp",
23    "src/napi_error.cpp",
24    "src/napi_utils.cpp",
25  ]
26  configs = [
27    "${battery_utils}:utils_config",
28    ":batterynapi_private_config",
29  ]
30  deps = [ "${battery_inner_api}:batterysrv_client" ]
31  external_deps = [
32    "c_utils:utils",
33    "hilog:libhilog",
34    "napi:ace_napi",
35  ]
36
37  relative_install_dir = "module"
38
39  subsystem_name = "powermgr"
40  part_name = "battery_manager"
41}
42
43ohos_shared_library("charger") {
44  sources = [ "src/charger.cpp" ]
45  configs = [
46    "${battery_utils}:utils_config",
47    "${battery_utils}:coverage_flags",
48  ]
49  deps = [ "${battery_inner_api}:batterysrv_client" ]
50  external_deps = [
51    "c_utils:utils",
52    "hilog:libhilog",
53    "napi:ace_napi",
54  ]
55
56  relative_install_dir = "module"
57
58  subsystem_name = "powermgr"
59  part_name = "battery_manager"
60}
61
62ohos_shared_library("battery") {
63  sources = [ "src/system_battery.cpp" ]
64  configs = [
65    "${battery_utils}:utils_config",
66    "${battery_utils}:coverage_flags",
67    ":batterynapi_private_config",
68  ]
69  deps = [ "${battery_inner_api}:batterysrv_client" ]
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73    "napi:ace_napi",
74  ]
75
76  relative_install_dir = "module"
77
78  subsystem_name = "powermgr"
79  part_name = "battery_manager"
80}
81