• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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_conn_manager_config") {
18  include_dirs = [
19    "include",
20    "include/stub",
21    "$INNERKITS_ROOT/include",
22    "$INNERKITS_ROOT/netconnclient/include",
23    "$INNERKITS_ROOT/netconnclient/include/proxy",
24    "$INNERKITS_ROOT/netmanagernative/include",
25    "$INNERKITS_ROOT/netstatsclient/include",
26    "$NETCONNMANAGER_COMMON_DIR/include",
27    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
28    "$NETSYSCONTROLLER_ROOT_DIR/include",
29    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient/include",
30    "$INNERKITS_ROOT/netmanagernative/include",
31  ]
32}
33
34ohos_shared_library("net_conn_manager") {
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39  }
40
41  branch_protector_ret = "pac_ret"
42
43  sources = [
44    "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp",
45    "src/dns_result_call_back.cpp",
46    "src/nat464_service.cpp",
47    "src/net_activate.cpp",
48    "src/net_caps.cpp",
49    "src/net_conn_event_handler.cpp",
50    "src/net_conn_service.cpp",
51    "src/net_conn_service_iface.cpp",
52    "src/net_datashare_utils.cpp",
53    "src/net_factoryreset_callback.cpp",
54    "src/net_http_probe.cpp",
55    "src/net_http_probe_result.cpp",
56    "src/net_http_proxy_tracker.cpp",
57    "src/net_monitor.cpp",
58    "src/net_proxy_userinfo.cpp",
59    "src/net_supplier.cpp",
60    "src/network.cpp",
61    "src/probe_thread.cpp",
62    "src/stub/net_conn_callback_proxy.cpp",
63    "src/stub/net_conn_service_stub.cpp",
64    "src/stub/net_detection_callback_proxy.cpp",
65    "src/stub/net_factoryreset_callback_proxy.cpp",
66    "src/stub/net_interface_callback_proxy.cpp",
67    "src/stub/net_supplier_callback_proxy.cpp",
68  ]
69
70  configs = [ ":net_conn_manager_config" ]
71
72  deps = [
73    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
74    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
75    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
76    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client",
77    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
78    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
79  ]
80
81  cflags = [
82    "-fvisibility=hidden",
83    "-fdata-sections",
84    "-ffunction-sections",
85    "-Os",
86    "-fstack-protector-strong",
87    "-D_FORTIFY_SOURCE=2",
88    "-O2",
89  ]
90
91  cflags_cc = [
92    "-fvisibility-inlines-hidden",
93    "-Os",
94    "-fstack-protector-strong",
95    "-D_FORTIFY_SOURCE=2",
96    "-O2",
97  ]
98
99  ldflags = [
100    "-Wl,--exclude-libs=ALL",
101    "-Wl,--gc-sections",
102  ]
103
104  external_deps = [
105    "ability_base:want",
106    "ability_base:zuri",
107    "ability_runtime:ability_manager",
108    "c_utils:utils",
109    "common_event_service:cesfwk_innerkits",
110    "curl:curl_shared",
111    "data_share:datashare_common",
112    "data_share:datashare_consumer",
113    "eventhandler:libeventhandler",
114    "ffrt:libffrt",
115    "hisysevent:libhisysevent",
116    "init:libbegetutil",
117    "ipc:ipc_core",
118    "os_account:os_account_innerkits",
119    "relational_store:native_rdb",
120    "safwk:system_ability_fwk",
121    "samgr:samgr_proxy",
122  ]
123
124  defines = [
125    "NETMGR_LOG_TAG = \"NetConnManager\"",
126    "LOG_DOMAIN = 0xD0015B0",
127  ]
128
129  if (enable_netmgr_debug) {
130    defines += [ "NETMGR_DEBUG" ]
131  }
132
133  if (enable_sys_func) {
134    defines += [ "SYS_FUNC" ]
135  }
136
137  external_deps += [ "hilog:libhilog" ]
138
139  part_name = "netmanager_base"
140  subsystem_name = "communication"
141}
142
143ohos_static_library("net_conn_manager_static") {
144  testonly = true
145  sanitize = {
146    cfi = true
147    cfi_cross_dso = true
148    debug = false
149  }
150
151  branch_protector_ret = "pac_ret"
152  use_exceptions = true
153  sources = [
154    "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp",
155    "src/dns_result_call_back.cpp",
156    "src/nat464_service.cpp",
157    "src/net_activate.cpp",
158    "src/net_caps.cpp",
159    "src/net_conn_event_handler.cpp",
160    "src/net_conn_service.cpp",
161    "src/net_conn_service_iface.cpp",
162    "src/net_datashare_utils.cpp",
163    "src/net_factoryreset_callback.cpp",
164    "src/net_http_probe.cpp",
165    "src/net_http_probe_result.cpp",
166    "src/net_http_proxy_tracker.cpp",
167    "src/net_monitor.cpp",
168    "src/net_proxy_userinfo.cpp",
169    "src/net_supplier.cpp",
170    "src/network.cpp",
171    "src/probe_thread.cpp",
172    "src/stub/net_conn_callback_proxy.cpp",
173    "src/stub/net_conn_service_stub.cpp",
174    "src/stub/net_detection_callback_proxy.cpp",
175    "src/stub/net_factoryreset_callback_proxy.cpp",
176    "src/stub/net_interface_callback_proxy.cpp",
177    "src/stub/net_supplier_callback_proxy.cpp",
178  ]
179  use_exceptions = true
180
181  configs = [ ":net_conn_manager_config" ]
182
183  deps = [
184    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
185    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
186    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
187    "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client",
188    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
189    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
190  ]
191
192  external_deps = [
193    "ability_base:zuri",
194    "ability_runtime:ability_manager",
195    "c_utils:utils",
196    "common_event_service:cesfwk_innerkits",
197    "curl:curl_shared",
198    "data_share:datashare_common",
199    "data_share:datashare_consumer",
200    "eventhandler:libeventhandler",
201    "ffrt:libffrt",
202    "hisysevent:libhisysevent",
203    "init:libbegetutil",
204    "ipc:ipc_core",
205    "os_account:os_account_innerkits",
206    "relational_store:native_rdb",
207    "safwk:system_ability_fwk",
208    "samgr:samgr_proxy",
209  ]
210
211  defines = [
212    "NETMGR_LOG_TAG = \"NetConnManager\"",
213    "LOG_DOMAIN = 0xD0015B0",
214  ]
215
216  if (enable_netmgr_debug) {
217    defines += [ "NETMGR_DEBUG" ]
218  }
219
220  if (enable_sys_func) {
221    defines += [ "SYS_FUNC" ]
222  }
223
224  external_deps += [ "hilog:libhilog" ]
225
226  part_name = "netmanager_base"
227  subsystem_name = "communication"
228}
229