# Copyright (c) 2023-2024 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_ext/netmanager_ext_config.gni") config("net_vpn_manager_config") { include_dirs = [ "$UTILS_ROOT/native/base/include", "$UTILS_ROOT/system/safwk/native/include", "$EXT_INNERKITS_ROOT/include", "$EXT_INNERKITS_ROOT/netvpnclient/include", "$EXT_INNERKITS_ROOT/netvpnclient/include/ipc", "$NETCONNMANAGER_COMMON_DIR/include", "$NETMANAGER_EXT_ROOT/utils/log/include", "$VPNMANAGER_SOURCE_DIR/include", "$VPNMANAGER_SOURCE_DIR/include/ipc", "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include", "$BASE_INNERKITS_ROOT/include", "$BASE_INNERKITS_ROOT/netconnclient/include", "$BASE_INNERKITS_ROOT/netsyscontroller/include", "$BASE_INNERKITS_ROOT/netmanagernative/include", "$NETMANAGERNATIVE_ROOT/include/netsys", "$NETSYSCONTROLLER_ROOT_DIR/include", "$NETMANAGER_BASE_ROOT/utils/common_utils/include", "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", "$NETMANAGER_EXT_ROOT/frameworks/js/napi/vpnext/include", ] defines = [ "NETMGR_LOG_TAG = \"NetworkVpnManager\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_ext_debug) { defines += [ "NETMGR_DEBUG" ] } } net_vpn_manager_sources = [ "$VPNMANAGER_SOURCE_DIR/src/extended_vpn_ctl.cpp", "$VPNMANAGER_SOURCE_DIR/src/ipc/networkvpn_service_stub.cpp", "$VPNMANAGER_SOURCE_DIR/src/ipc/vpn_event_callback_proxy.cpp", "$VPNMANAGER_SOURCE_DIR/src/net_vpn_impl.cpp", "$VPNMANAGER_SOURCE_DIR/src/networkvpn_hisysevent.cpp", "$VPNMANAGER_SOURCE_DIR/src/networkvpn_service.cpp", "$VPN_INNERKITS_SOURCE_DIR/src/vpn_config.cpp", ] net_vpn_manager_deps = [ "$NETMANAGER_EXT_ROOT/utils:net_event_report" ] net_vpn_manager_external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "cJSON:cjson", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "netmanager_base:net_conn_manager_if", "netmanager_base:net_data_share", "netmanager_base:net_manager_common", "netmanager_base:netsys_controller", "os_account:os_account_innerkits", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] ohos_shared_library("net_vpn_manager") { sanitize = { cfi = true cfi_cross_dso = true blocklist = "./cfi_blocklist.txt" debug = false } branch_protector_ret = "pac_ret" configs = [ ":net_vpn_manager_config" ] sources = net_vpn_manager_sources deps = net_vpn_manager_deps external_deps = net_vpn_manager_external_deps cflags = memory_optimization_cflags cflags += [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = memory_optimization_cflags_cc cflags_cc += [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] ldflags = memory_optimization_ldflags part_name = "netmanager_ext" subsystem_name = "communication" } ohos_static_library("net_vpn_manager_static") { sanitize = { cfi = true cfi_cross_dso = true blocklist = "./cfi_blocklist.txt" debug = false } branch_protector_ret = "pac_ret" configs = [ ":net_vpn_manager_config" ] sources = net_vpn_manager_sources deps = net_vpn_manager_deps external_deps = net_vpn_manager_external_deps part_name = "netmanager_ext" subsystem_name = "communication" }