• 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_ext/netmanager_ext_config.gni")
16
17config("net_vpn_manager_config") {
18  include_dirs = [
19    "$UTILS_ROOT/native/base/include",
20    "$UTILS_ROOT/system/safwk/native/include",
21    "$EXT_INNERKITS_ROOT/include",
22    "$EXT_INNERKITS_ROOT/netvpnclient/include",
23    "$EXT_INNERKITS_ROOT/netvpnclient/include/ipc",
24    "$NETCONNMANAGER_COMMON_DIR/include",
25    "$NETMANAGER_EXT_ROOT/utils/log/include",
26    "$VPNMANAGER_SOURCE_DIR/include",
27    "$VPNMANAGER_SOURCE_DIR/include/ipc",
28    "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include",
29    "$BASE_INNERKITS_ROOT/include",
30    "$BASE_INNERKITS_ROOT/netconnclient/include",
31    "$BASE_INNERKITS_ROOT/netsyscontroller/include",
32    "$BASE_INNERKITS_ROOT/netmanagernative/include",
33    "$NETMANAGERNATIVE_ROOT/include/netsys",
34    "$NETSYSCONTROLLER_ROOT_DIR/include",
35    "$NETMANAGER_BASE_ROOT/utils/common_utils/include",
36    "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include",
37    "$NETMANAGER_EXT_ROOT/frameworks/js/napi/vpnext/include",
38  ]
39
40  defines = [
41    "NETMGR_LOG_TAG = \"NetworkVpnManager\"",
42    "LOG_DOMAIN = 0xD0015B0",
43  ]
44
45  if (enable_netmgr_ext_debug) {
46    defines += [ "NETMGR_DEBUG" ]
47  }
48}
49
50net_vpn_manager_sources = [
51  "$VPNMANAGER_SOURCE_DIR/src/extended_vpn_ctl.cpp",
52  "$VPNMANAGER_SOURCE_DIR/src/ipc/networkvpn_service_stub.cpp",
53  "$VPNMANAGER_SOURCE_DIR/src/ipc/vpn_event_callback_proxy.cpp",
54  "$VPNMANAGER_SOURCE_DIR/src/net_vpn_impl.cpp",
55  "$VPNMANAGER_SOURCE_DIR/src/networkvpn_hisysevent.cpp",
56  "$VPNMANAGER_SOURCE_DIR/src/networkvpn_service.cpp",
57  "$VPN_INNERKITS_SOURCE_DIR/src/vpn_config.cpp",
58]
59
60net_vpn_manager_deps = [ "$NETMANAGER_EXT_ROOT/utils:net_event_report" ]
61
62net_vpn_manager_external_deps = [
63  "ability_base:want",
64  "ability_base:zuri",
65  "bundle_framework:appexecfwk_base",
66  "bundle_framework:appexecfwk_core",
67  "c_utils:utils",
68  "common_event_service:cesfwk_innerkits",
69  "eventhandler:libeventhandler",
70  "hilog:libhilog",
71  "hisysevent:libhisysevent",
72  "ipc:ipc_core",
73  "netmanager_base:net_conn_manager_if",
74  "netmanager_base:net_data_share",
75  "netmanager_base:net_manager_common",
76  "netmanager_base:netsys_controller",
77  "os_account:os_account_innerkits",
78  "safwk:system_ability_fwk",
79  "samgr:samgr_proxy",
80]
81
82ohos_shared_library("net_vpn_manager") {
83  configs = [ ":net_vpn_manager_config" ]
84
85  sources = net_vpn_manager_sources
86  deps = net_vpn_manager_deps
87  external_deps = net_vpn_manager_external_deps
88
89  cflags = memory_optimization_cflags
90  cflags += [
91    "-fstack-protector-strong",
92    "-D_FORTIFY_SOURCE=2",
93    "-O2",
94  ]
95
96  cflags_cc = memory_optimization_cflags_cc
97  cflags_cc += [
98    "-fstack-protector-strong",
99    "-D_FORTIFY_SOURCE=2",
100    "-O2",
101  ]
102
103  ldflags = memory_optimization_ldflags
104
105  part_name = "netmanager_ext"
106  subsystem_name = "communication"
107}
108
109ohos_static_library("net_vpn_manager_static") {
110  configs = [ ":net_vpn_manager_config" ]
111
112  sources = net_vpn_manager_sources
113  deps = net_vpn_manager_deps
114  external_deps = net_vpn_manager_external_deps
115
116  part_name = "netmanager_ext"
117  subsystem_name = "communication"
118}
119