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("//build/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17config("net_stats_manager_if_config") { 18 # header file path 19 include_dirs = [ 20 "$INNERKITS_ROOT/netstatsclient/include/proxy", 21 "$INNERKITS_ROOT/netstatsclient/include", 22 "$INNERKITS_ROOT/netmanagernative/include", 23 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 24 ] 25 26 cflags = [] 27 if (is_double_framework) { 28 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 29 } 30 if (target_cpu == "arm") { 31 cflags += [ "-DBINDER_IPC_32BIT" ] 32 } 33 if (is_standard_system) { 34 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 35 } 36 if (defined(build_public_version) && build_public_version) { 37 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 38 } 39} 40 41ohos_source_set("net_stats_parcel") { 42 sources = [ "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_info.cpp" ] 43 44 include_dirs = [ "$INNERKITS_ROOT/netstatsclient/include" ] 45 46 deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ] 47 48 external_deps = [ "c_utils:utils" ] 49 if (is_standard_system) { 50 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 51 } else { 52 external_deps += [ "hilog:libhilog" ] 53 } 54 55 part_name = "netmanager_base" 56 subsystem_name = "communication" 57} 58 59ohos_shared_library("net_stats_manager_if") { 60 sources = [ 61 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/data_flow_statistics.cpp", 62 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_client.cpp", 63 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_callback_stub.cpp", 64 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_service_proxy.cpp", 65 ] 66 67 include_dirs = [ 68 "$NETMANAGER_BASE_ROOT/utils/log/include", 69 "$NETSYSCONTROLLER_ROOT_DIR/include/", 70 ] 71 72 public_configs = [ ":net_stats_manager_if_config" ] 73 74 deps = [ 75 ":net_stats_parcel", 76 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 77 ] 78 79 external_deps = [ 80 "ipc:ipc_core", 81 "samgr:samgr_proxy", 82 ] 83 84 defines = [ 85 "NETMGR_LOG_TAG = \"NetStatsClient\"", 86 "LOG_DOMAIN = 0xD0015B0", 87 ] 88 89 if (enable_netmgr_debug) { 90 defines += [ "NETMGR_DEBUG" ] 91 } 92 93 if (is_standard_system) { 94 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 95 } else { 96 external_deps += [ "hilog:libhilog" ] 97 } 98 99 part_name = "netmanager_base" 100 subsystem_name = "communication" 101} 102