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 cflags += [ 42 "-fstack-protector-strong", 43 "-D_FORTIFY_SOURCE=2", 44 "-O2", 45 ] 46 47 cflags_cc = [ 48 "-fstack-protector-strong", 49 "-D_FORTIFY_SOURCE=2", 50 "-O2", 51 ] 52} 53 54ohos_source_set("net_stats_parcel") { 55 sources = [ "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_info.cpp" ] 56 sanitize = { 57 cfi = true 58 debug = false 59 } 60 include_dirs = [ "$INNERKITS_ROOT/netstatsclient/include" ] 61 62 deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ] 63 external_deps = [ "c_utils:utils" ] 64 external_deps += [ "hilog:libhilog" ] 65 66 part_name = "netmanager_base" 67 subsystem_name = "communication" 68} 69 70ohos_shared_library("net_stats_manager_if") { 71 sanitize = { 72 cfi = true 73 boundary_sanitize = true 74 all_ubsan = true 75 debug = false 76 } 77 78 sources = [ 79 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/data_flow_statistics.cpp", 80 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/net_stats_client.cpp", 81 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_callback_stub.cpp", 82 "$NETSTATSMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_stats_service_proxy.cpp", 83 ] 84 85 include_dirs = [ 86 "$NETMANAGER_BASE_ROOT/utils/log/include", 87 "$NETSYSCONTROLLER_ROOT_DIR/include/", 88 ] 89 90 version_script = "libnetstats_kits.map" 91 92 public_configs = [ ":net_stats_manager_if_config" ] 93 94 deps = [ 95 ":net_stats_parcel", 96 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 97 ] 98 99 external_deps = [ 100 "ipc:ipc_single", 101 "samgr:samgr_proxy", 102 ] 103 104 defines = [ 105 "NETMGR_LOG_TAG = \"NetStatsClient\"", 106 "LOG_DOMAIN = 0xD0015B0", 107 ] 108 109 if (enable_netmgr_debug) { 110 defines += [ "NETMGR_DEBUG" ] 111 } 112 113 external_deps += [ "hilog:libhilog" ] 114 115 innerapi_tags = [ "platformsdk" ] 116 part_name = "netmanager_base" 117 subsystem_name = "communication" 118} 119