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_conn_manager_if_config") { 18 include_dirs = [ 19 "include", 20 "include/ipc", 21 "$BASE_INNERKITS_ROOT/include", 22 "$BASE_INNERKITS_ROOT/netconnclient/include", 23 "$BASE_INNERKITS_ROOT/netmanagernative/include", 24 "$NETMANAGERNATIVE_ROOT/fwmarkclient/include", 25 "$EXT_INNERKITS_ROOT/include", 26 "$NETMANAGER_EXT_ROOT/utils/log/include", 27 ] 28 29 defines = [] 30 if (is_double_framework) { 31 defines += [ "CONFIG_DUAL_FRAMEWORK" ] 32 } 33 if (target_cpu == "arm") { 34 defines += [ "BINDER_IPC_32BIT" ] 35 } 36 if (is_standard_system) { 37 defines += [ "CONFIG_STANDARD_SYSTEM" ] 38 } 39 if (defined(build_public_version) && build_public_version) { 40 defines += [ "BUILD_PUBLIC_VERSION" ] 41 } 42 43 cflags = [ 44 "-fstack-protector-strong", 45 "-D_FORTIFY_SOURCE=2", 46 "-O2", 47 ] 48 49 cflags_cc = [ 50 "-fstack-protector-strong", 51 "-D_FORTIFY_SOURCE=2", 52 "-O2", 53 ] 54} 55 56ohos_source_set("networkvpn_parcel") { 57 sources = [ "$VPN_INNERKITS_SOURCE_DIR/src/vpn_config.cpp" ] 58 59 include_dirs = [ 60 "$BASE_INNERKITS_ROOT/include", 61 "$BASE_INNERKITS_ROOT/netconnclient/include", 62 "$EXT_INNERKITS_ROOT/include", 63 "$EXT_INNERKITS_ROOT/netvpnclient/include", 64 "$NETMANAGER_EXT_ROOT/utils/log/include", 65 ] 66 67 external_deps = [ 68 "c_utils:utils", 69 "hilog:libhilog", 70 "netmanager_base:net_conn_parcel", 71 "netmanager_base:net_manager_common", 72 ] 73 74 part_name = "netmanager_ext" 75 subsystem_name = "communication" 76} 77 78ohos_shared_library("net_vpn_manager_if") { 79 sources = [ 80 "$VPN_INNERKITS_SOURCE_DIR/src/ipc/networkvpn_service_proxy.cpp", 81 "$VPN_INNERKITS_SOURCE_DIR/src/ipc/vpn_event_callback_stub.cpp", 82 "$VPN_INNERKITS_SOURCE_DIR/src/networkvpn_client.cpp", 83 "$VPN_INNERKITS_SOURCE_DIR/src/vpn_interface.cpp", 84 ] 85 86 public_configs = [ ":net_conn_manager_if_config" ] 87 88 deps = [ ":networkvpn_parcel" ] 89 90 external_deps = [ 91 "hilog:libhilog", 92 "ipc:ipc_single", 93 "netmanager_base:fwmark_client", 94 "samgr:samgr_proxy", 95 ] 96 97 defines = [ 98 "NETMGR_LOG_TAG = \"NetworkVpn\"", 99 "LOG_DOMAIN = 0xD0015B0", 100 ] 101 102 if (enable_netmgr_ext_debug) { 103 defines += [ "NETMGR_DEBUG" ] 104 } 105 106 part_name = "netmanager_ext" 107 subsystem_name = "communication" 108} 109