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