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_extension_if_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "include", 21 "include/ipc", 22 "$EXT_INNERKITS_ROOT/include", 23 ] 24 25 defines = [] 26 if (is_double_framework) { 27 defines += [ "CONFIG_DUAL_FRAMEWORK" ] 28 } 29 if (target_cpu == "arm") { 30 defines += [ "BINDER_IPC_32BIT" ] 31 } 32 if (is_standard_system) { 33 defines += [ "CONFIG_STANDARD_SYSTEM" ] 34 } 35 if (defined(build_public_version) && build_public_version) { 36 defines += [ "BUILD_PUBLIC_VERSION" ] 37 } 38} 39 40ohos_shared_library("vpn_extension") { 41 sanitize = { 42 cfi = true 43 cfi_cross_dso = true 44 debug = false 45 } 46 47 branch_protector_ret = "pac_ret" 48 49 sources = [ 50 "$VPN_EXTENSION_SOURCE_DIR/src/js_vpn_extension.cpp", 51 "$VPN_EXTENSION_SOURCE_DIR/src/js_vpn_extension_context.cpp", 52 "$VPN_EXTENSION_SOURCE_DIR/src/vpn_extension.cpp", 53 "$VPN_EXTENSION_SOURCE_DIR/src/vpn_extension_context.cpp", 54 ] 55 configs = [ ":net_vpn_extension_if_config" ] 56 public_configs = [ ":net_vpn_extension_if_config" ] 57 58 include_dirs = [ 59 "$EXT_INNERKITS_ROOT/include", 60 ] 61 62 deps = [ 63 "$NETMANAGER_EXT_ROOT/interfaces/innerkits/netvpnclient:net_vpn_manager_if", 64 ] 65 66 external_deps = [ 67 "ability_base:configuration", 68 "ability_base:want", 69 "ability_runtime:ability_connect_callback_stub", 70 "ability_runtime:ability_context_native", 71 "ability_runtime:ability_manager", 72 "ability_runtime:abilitykit_native", 73 "ability_runtime:app_context", 74 "ability_runtime:dataobs_manager", 75 "ability_runtime:extensionkit_native", 76 "ability_runtime:napi_common", 77 "ability_runtime:runtime", 78 "access_token:libaccesstoken_sdk", 79 "access_token:libtokenid_sdk", 80 "c_utils:utils", 81 "common_event_service:cesfwk_innerkits", 82 "eventhandler:libeventhandler", 83 "hilog:libhilog", 84 "hitrace:hitrace_meter", 85 "init:libbegetutil", 86 "ipc:ipc_core", 87 "ipc:ipc_napi", 88 "ipc:ipc_single", 89 "napi:ace_napi", 90 "netmanager_base:fwmark_client", 91 "netmanager_base:napi_utils", 92 "netmanager_base:net_conn_manager_if", 93 "netmanager_base:net_manager_common", 94 "netmanager_base:net_native_manager_if", 95 "safwk:system_ability_fwk", 96 "samgr:samgr_proxy", 97 "window_manager:libdm", 98 "window_manager:libwm", 99 ] 100 101 public_external_deps = [ 102 "netmanager_base:net_manager_common", 103 "netmanager_base:net_native_manager_if", 104 ] 105 106 defines = [ 107 "NETMGR_LOG_TAG = \"NetworkVpn\"", 108 "LOG_DOMAIN = 0xD0015B0", 109 ] 110 111 if (enable_netmgr_ext_debug) { 112 defines += [ "NETMGR_DEBUG" ] 113 } 114 115 part_name = "netmanager_ext" 116 subsystem_name = "communication" 117} 118 119ohos_shared_library("vpn_extension_module") { 120 sanitize = { 121 cfi = true 122 cfi_cross_dso = true 123 debug = false 124 } 125 126 branch_protector_ret = "pac_ret" 127 128 include_dirs = 129 [ "$VPN_EXTENSION_SOURCE_DIR/interfaces/innerkits/vpnextension" ] 130 131 sources = [ "$VPN_EXTENSION_SOURCE_DIR/src/vpn_extension_module_loader.cpp" ] 132 133 configs = [ ":net_vpn_extension_if_config" ] 134 public_configs = [ ":net_vpn_extension_if_config" ] 135 136 deps = [ ":vpn_extension" ] 137 138 external_deps = [ 139 "ability_base:configuration", 140 "ability_base:session_info", 141 "ability_runtime:abilitykit_native", 142 "ability_runtime:runtime", 143 "bundle_framework:appexecfwk_base", 144 "bundle_framework:appexecfwk_core", 145 "c_utils:utils", 146 "hilog:libhilog", 147 "ipc:ipc_single", 148 "napi:ace_napi", 149 "netmanager_base:net_manager_common", 150 "netmanager_base:net_native_manager_if", 151 "window_manager:libdm", 152 "ipc:ipc_napi", 153 ] 154 155 public_external_deps = [ 156 "netmanager_base:net_manager_common", 157 "netmanager_base:net_native_manager_if", 158 ] 159 160 relative_install_dir = "extensionability/" 161 part_name = "netmanager_ext" 162 subsystem_name = "communication" 163} 164