1# Copyright (c) 2021 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("//base/powermgr/powermgr_lite/powermgr.gni")
15import("//build/lite/config/component/lite_component.gni")
16
17config("powermgr_utils_public_config") {
18  include_dirs = [ "include" ]
19}
20
21utils_sources = [
22  "src/power_mgr_time_util.c",
23  "src/power_mgr_timer_util.c",
24]
25
26if (is_liteos_m) {
27  static_library("powermgr_utils") {
28    sources = utils_sources
29
30    public_configs = [ ":powermgr_utils_public_config" ]
31
32    include_dirs = [
33      "${powermgr_frameworks_path}/include",
34      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
35    ]
36
37    deps = [
38      "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
39      "//kernel/liteos_m/kernel:kernel",
40    ]
41  }
42} else {
43  source_set("powermgr_utils") {
44    cflags = [ "-fPIC" ]
45    cflags_cc = cflags
46
47    sources = utils_sources
48
49    public_configs = [ ":powermgr_utils_public_config" ]
50    include_dirs = [ "${powermgr_frameworks_path}/include" ]
51
52    deps = [ "//foundation/systemabilitymgr/samgr_lite/samgr:samgr" ]
53  }
54}
55