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