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