1413470f0Sopenharmony_ci# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2413470f0Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3413470f0Sopenharmony_ci# you may not use this file except in compliance with the License.
4413470f0Sopenharmony_ci# You may obtain a copy of the License at
5413470f0Sopenharmony_ci#
6413470f0Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7413470f0Sopenharmony_ci#
8413470f0Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9413470f0Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10413470f0Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11413470f0Sopenharmony_ci# See the License for the specific language governing permissions and
12413470f0Sopenharmony_ci# limitations under the License.
13413470f0Sopenharmony_ci
14413470f0Sopenharmony_ciimport("//base/powermgr/battery_lite/batterymgr.gni")
15413470f0Sopenharmony_ciimport("//build/lite/config/component/lite_component.gni")
16413470f0Sopenharmony_ci
17413470f0Sopenharmony_cilocal_include_dirs = []
18413470f0Sopenharmony_cilocal_deps = []
19413470f0Sopenharmony_cilocal_sources = []
20413470f0Sopenharmony_ci
21413470f0Sopenharmony_ciif (battery_mini_system) {
22413470f0Sopenharmony_ci  local_include_dirs += [
23413470f0Sopenharmony_ci    "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
24413470f0Sopenharmony_ci    "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
25413470f0Sopenharmony_ci    "//base/powermgr/battery_lite/services/src/small:battery_feature_impl",
26413470f0Sopenharmony_ci  ]
27413470f0Sopenharmony_ci  local_deps +=
28413470f0Sopenharmony_ci      [ "//base/powermgr/battery_lite/services/src/mini:battery_feature_impl" ]
29413470f0Sopenharmony_ci} else {
30413470f0Sopenharmony_ci  local_include_dirs += [ "${batterymgr_frameworks_path}/include" ]
31413470f0Sopenharmony_ci  local_deps += [
32413470f0Sopenharmony_ci    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
33413470f0Sopenharmony_ci    "//base/powermgr/battery_lite/services/src/small:battery_feature_impl",
34413470f0Sopenharmony_ci  ]
35413470f0Sopenharmony_ci}
36413470f0Sopenharmony_ci
37413470f0Sopenharmony_cilite_library("batteryservice") {
38413470f0Sopenharmony_ci  target_type = battery_library_type
39413470f0Sopenharmony_ci
40413470f0Sopenharmony_ci  sources = [
41413470f0Sopenharmony_ci    "src/battery_device.c",
42413470f0Sopenharmony_ci    "src/battery_manage_feature.c",
43413470f0Sopenharmony_ci    "src/battery_manage_service.c",
44413470f0Sopenharmony_ci  ]
45413470f0Sopenharmony_ci  sources += local_sources
46413470f0Sopenharmony_ci
47413470f0Sopenharmony_ci  include_dirs = [
48413470f0Sopenharmony_ci    "include",
49413470f0Sopenharmony_ci    "${batterymgr_kits_path}",
50413470f0Sopenharmony_ci    "${batterymgr_frameworks_path}/include",
51413470f0Sopenharmony_ci    "${batterymgr_frameworks_path}/include/${battery_system_type}",
52413470f0Sopenharmony_ci    "${batterymgr_services_path}/include",
53413470f0Sopenharmony_ci    "${batterymgr_services_path}/include/${battery_system_type}",
54413470f0Sopenharmony_ci    "//commonlibrary/utils_lite/include",
55413470f0Sopenharmony_ci    "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
56413470f0Sopenharmony_ci    "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
57413470f0Sopenharmony_ci  ]
58413470f0Sopenharmony_ci  include_dirs += local_include_dirs
59413470f0Sopenharmony_ci
60413470f0Sopenharmony_ci  deps = [
61413470f0Sopenharmony_ci    "${batterymgr_utils_path}:powermgr_utils",
62413470f0Sopenharmony_ci    "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
63413470f0Sopenharmony_ci    "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
64413470f0Sopenharmony_ci  ]
65413470f0Sopenharmony_ci  deps += local_deps
66413470f0Sopenharmony_ci}
67