# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/communication/netmanager_base/netmanager_base_config.gni") config("net_conn_manager_config") { include_dirs = [ "include", "include/stub", "$INNERKITS_ROOT/include", "$INNERKITS_ROOT/netconnclient/include", "$INNERKITS_ROOT/netconnclient/include/proxy", "$INNERKITS_ROOT/netmanagernative/include", "$INNERKITS_ROOT/netstatsclient/include", "$NETCONNMANAGER_COMMON_DIR/include", "$NETSYSNATIVE_SOURCE_DIR/include/netsys", "$NETSYSCONTROLLER_ROOT_DIR/include", "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient/include", "$INNERKITS_ROOT/netmanagernative/include", "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", "$THIRD_PARTY_ROOT/curl/include", ] } ohos_shared_library("net_conn_manager") { sanitize = { cfi = true cfi_cross_dso = true boundary_sanitize = true all_ubsan = true blocklist = "./connect_blocklist.txt" debug = false } sources = [ "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp", "src/dns_result_call_back.cpp", "src/net_activate.cpp", "src/net_caps.cpp", "src/net_conn_event_handler.cpp", "src/net_conn_service.cpp", "src/net_conn_service_iface.cpp", "src/net_datashare_utils.cpp", "src/net_factoryreset_callback.cpp", "src/net_http_probe.cpp", "src/net_http_probe_result.cpp", "src/net_http_proxy_tracker.cpp", "src/net_monitor.cpp", "src/net_score.cpp", "src/net_supplier.cpp", "src/network.cpp", "src/stub/net_conn_callback_proxy.cpp", "src/stub/net_conn_service_stub.cpp", "src/stub/net_detection_callback_proxy.cpp", "src/stub/net_factoryreset_callback_proxy.cpp", "src/stub/net_interface_callback_proxy.cpp", "src/stub/net_supplier_callback_proxy.cpp", ] configs = [ ":net_conn_manager_config" ] deps = [ "$NETCONNMANAGER_COMMON_DIR:net_service_common", "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager", "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client", "$NETMANAGER_BASE_ROOT/utils:net_manager_common", "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", "$THIRD_PARTY_ROOT/curl:curl_shared", ] cflags = [ "-fvisibility=hidden", "-fdata-sections", "-ffunction-sections", "-Os", "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fvisibility-inlines-hidden", "-Os", "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] ldflags = [ "-Wl,--exclude-libs=ALL", "-Wl,--gc-sections", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_common", "data_share:datashare_consumer", "eventhandler:libeventhandler", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "NETMGR_LOG_TAG = \"NetConnManager\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_debug) { defines += [ "NETMGR_DEBUG" ] } if (enable_sys_func) { defines += [ "SYS_FUNC" ] } external_deps += [ "hilog:libhilog" ] part_name = "netmanager_base" subsystem_name = "communication" } ohos_static_library("net_conn_manager_static") { testonly = true sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "$NETCONNMANAGER_COMMON_DIR/src/route_utils.cpp", "src/dns_result_call_back.cpp", "src/net_activate.cpp", "src/net_caps.cpp", "src/net_conn_event_handler.cpp", "src/net_conn_service.cpp", "src/net_conn_service_iface.cpp", "src/net_datashare_utils.cpp", "src/net_factoryreset_callback.cpp", "src/net_http_probe.cpp", "src/net_http_probe_result.cpp", "src/net_http_proxy_tracker.cpp", "src/net_monitor.cpp", "src/net_score.cpp", "src/net_supplier.cpp", "src/network.cpp", "src/stub/net_conn_callback_proxy.cpp", "src/stub/net_conn_service_stub.cpp", "src/stub/net_detection_callback_proxy.cpp", "src/stub/net_factoryreset_callback_proxy.cpp", "src/stub/net_interface_callback_proxy.cpp", "src/stub/net_supplier_callback_proxy.cpp", ] configs = [ ":net_conn_manager_config" ] deps = [ "$NETCONNMANAGER_COMMON_DIR:net_service_common", "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager", "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client", "$NETMANAGER_BASE_ROOT/utils:net_manager_common", "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", "$THIRD_PARTY_ROOT/curl:curl_shared", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_common", "data_share:datashare_consumer", "eventhandler:libeventhandler", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "NETMGR_LOG_TAG = \"NetConnManager\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_debug) { defines += [ "NETMGR_DEBUG" ] } if (enable_sys_func) { defines += [ "SYS_FUNC" ] } external_deps += [ "hilog:libhilog" ] part_name = "netmanager_base" subsystem_name = "communication" }