1# Copyright (c) 2021-2022 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/include", 21 "$INNERKITS_ROOT/netstatsclient/include/proxy", 22 "$INNERKITS_ROOT/netstatsclient/include", 23 "$INNERKITS_ROOT/netmanagernative/include", 24 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 25 ] 26 27 cflags = [] 28 if (is_double_framework) { 29 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 30 } 31 if (target_cpu == "arm") { 32 cflags += [ "-DBINDER_IPC_32BIT" ] 33 } 34 if (is_standard_system) { 35 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 36 } 37 if (defined(build_public_version) && build_public_version) { 38 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 39 } 40} 41 42ohos_source_set("net_stats_parcel") { 43 sources = [ "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_info.cpp" ] 44 cflags = [ 45 "-flto", 46 "-fsanitize=cfi", 47 "-fsanitize-cfi-cross-dso", 48 "-fvisibility=hidden", 49 ] 50 ldflags = [ 51 "-flto", 52 "-fsanitize=cfi", 53 "-fsanitize-cfi-cross-dso", 54 ] 55 include_dirs = [ "$INNERKITS_ROOT/netstatsclient/include" ] 56 57 deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ] 58 external_deps = [ "c_utils:utils" ] 59 external_deps += [ "hilog:libhilog" ] 60 61 part_name = "netmanager_base" 62 subsystem_name = "communication" 63} 64 65ohos_shared_library("net_stats_manager_if") { 66 sanitize = { 67 cfi = true 68 cfi_cross_dso = true 69 boundary_sanitize = true 70 all_ubsan = true 71 debug = false 72 } 73 74 sources = [ 75 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/data_flow_statistics.cpp", 76 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_client.cpp", 77 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_callback_stub.cpp", 78 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_service_proxy.cpp", 79 ] 80 81 include_dirs = [ 82 "$NETMANAGER_BASE_ROOT/utils/log/include", 83 "$NETSYSCONTROLLER_ROOT_DIR/include/", 84 ] 85 86 version_script = "libnetstats_kits.map" 87 88 public_configs = [ ":net_stats_manager_if_config" ] 89 90 deps = [ 91 ":net_stats_parcel", 92 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 93 ] 94 95 external_deps = [ 96 "ipc:ipc_single", 97 "samgr:samgr_proxy", 98 ] 99 100 defines = [ 101 "NETMGR_LOG_TAG = \"NetStatsClient\"", 102 "LOG_DOMAIN = 0xD0015B0", 103 ] 104 105 if (enable_netmgr_debug) { 106 defines += [ "NETMGR_DEBUG" ] 107 } 108 109 external_deps += [ "hilog:libhilog" ] 110 111 innerapi_tags = [ "platformsdk" ] 112 part_name = "netmanager_base" 113 subsystem_name = "communication" 114} 115