1# Copyright (c) 2022-2024 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("//build/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17config("statistics_config") { 18 visibility = [ ":statistics" ] 19 20 include_dirs = [ 21 "include", 22 "include/context", 23 ] 24 25 cflags = [ 26 "-fstack-protector-strong", 27 "-D_FORTIFY_SOURCE=2", 28 "-O2", 29 ] 30 31 cflags_cc = [ 32 "-fstack-protector-strong", 33 "-D_FORTIFY_SOURCE=2", 34 "-O2", 35 ] 36} 37 38ohos_shared_library("statistics") { 39 sanitize = { 40 cfi = true 41 cfi_cross_dso = true 42 boundary_sanitize = true 43 all_ubsan = true 44 debug = false 45 } 46 47 branch_protector_ret = "pac_ret" 48 49 sources = [ 50 "src/context/get_cellular_rxbytes_context.cpp", 51 "src/context/get_iface_rxbytes_context.cpp", 52 "src/context/get_iface_stats_context.cpp", 53 "src/context/get_iface_uid_stats_context.cpp", 54 "src/context/get_sockfd_rxbytes_context.cpp", 55 "src/context/get_traffic_stats_by_network_context.cpp", 56 "src/context/get_traffic_stats_by_uid_network_context.cpp", 57 "src/context/get_uid_rxbytes_context.cpp", 58 "src/context/update_iface_stats_context.cpp", 59 "src/statistics_async_work.cpp", 60 "src/statistics_callback_observer.cpp", 61 "src/statistics_exec.cpp", 62 "src/statistics_module.cpp", 63 "src/statistics_observer_wrapper.cpp", 64 ] 65 66 configs = [ ":statistics_config" ] 67 68 deps = [ 69 "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", 70 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 71 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 72 ] 73 74 external_deps = [ 75 "c_utils:utils", 76 "hilog:libhilog", 77 "ipc:ipc_core", 78 "napi:ace_napi", 79 ] 80 81 relative_install_dir = "module/net" 82 part_name = "netmanager_base" 83 subsystem_name = "communication" 84} 85