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("../batterystats.gni") 15 16config("batterystats_utils_config") { 17 include_dirs = [ 18 "native/include", 19 "${batterystats_inner_api}/include", 20 ] 21} 22 23declare_args() { 24 battery_statistics_feature_coverage = false 25} 26 27config("coverage_flags") { 28 if (battery_statistics_feature_coverage) { 29 cflags = [ "--coverage" ] 30 cflags_cc = [ "--coverage" ] 31 ldflags = [ "--coverage" ] 32 } 33} 34 35ohos_static_library("batterystats_utils") { 36 branch_protector_ret = "pac_ret" 37 38 sources = [ 39 "native/src/stats_helper.cpp", 40 "native/src/stats_hisysevent.cpp", 41 "native/src/stats_utils.cpp", 42 ] 43 44 configs = [ "${batterystats_utils_path}:coverage_flags" ] 45 46 public_configs = [ ":batterystats_utils_config" ] 47 external_deps = [ 48 "c_utils:utils", 49 "hilog:libhilog", 50 ] 51 subsystem_name = "powermgr" 52 part_name = "${batterystats_part_name}" 53} 54