• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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_native_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_native_parcel") {
43  sources = [
44    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR/dhcp_result_parcel.cpp",
45    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR/uid_range.cpp",
46  ]
47
48  include_dirs = [ "$INNERKITS_ROOT/netmanagernative/include" ]
49
50  deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ]
51  external_deps = [ "c_utils:utils" ]
52  external_deps += [ "hilog:libhilog" ]
53
54  part_name = "netmanager_base"
55  subsystem_name = "communication"
56}
57
58ohos_shared_library("net_native_manager_if") {
59  sanitize = {
60    cfi = true
61    cfi_cross_dso = true
62    debug = false
63  }
64  sources = [
65    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR/netsys_addr_info_parcel.cpp",
66    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR/netsys_native_service_proxy.cpp",
67    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR/notify_callback_proxy.cpp",
68  ]
69
70  include_dirs = [
71    "$NETMANAGER_BASE_ROOT/utils/log/include",
72    "$NETSYSCONTROLLER_ROOT_DIR/include/",
73  ]
74
75  public_configs = [ ":net_native_manager_if_config" ]
76
77  deps = [
78    ":net_native_parcel",
79    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
80    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
81  ]
82
83  external_deps = [
84    "ipc:ipc_single",
85    "samgr:samgr_proxy",
86  ]
87
88  defines = [
89    "NETMGR_LOG_TAG = \"NetNativeMnager\"",
90    "LOG_DOMAIN = 0xD0015B0",
91  ]
92
93  if (enable_netmgr_debug) {
94    defines += [ "NETMGR_DEBUG" ]
95  }
96
97  external_deps += [ "hilog:libhilog" ]
98
99  innerapi_tags = [ "platformsdk" ]
100  part_name = "netmanager_base"
101  subsystem_name = "communication"
102}
103