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