1# Copyright (c) 2021 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_base/netmanager_base_config.gni") 16 17config("net_conn_manager_if_config") { 18 # header file path 19 include_dirs = [ 20 "$INNERKITS_ROOT/netconnclient/include", 21 "$INNERKITS_ROOT/netconnclient/include/proxy", 22 "$INNERKITS_ROOT/include", 23 ] 24 25 cflags = [] 26 if (is_double_framework) { 27 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 28 } 29 if (target_cpu == "arm") { 30 cflags += [ "-DBINDER_IPC_32BIT" ] 31 } 32 if (is_standard_system) { 33 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 34 } 35 if (defined(build_public_version) && build_public_version) { 36 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 37 } 38} 39 40ohos_source_set("net_conn_parcel") { 41 sources = [ 42 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/http_proxy.cpp", 43 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/inet_addr.cpp", 44 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_all_capabilities.cpp", 45 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_link_info.cpp", 46 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_specifier.cpp", 47 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_supplier_info.cpp", 48 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/route.cpp", 49 ] 50 51 include_dirs = [ 52 "$INNERKITS_ROOT/include", 53 "$INNERKITS_ROOT/netconnclient/include", 54 "$INNERKITS_ROOT/netmanagernative/include", 55 ] 56 57 deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ] 58 59 external_deps = [ "c_utils:utils" ] 60 if (is_standard_system) { 61 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 62 } else { 63 external_deps += [ "hilog:libhilog" ] 64 } 65 66 part_name = "netmanager_base" 67 subsystem_name = "communication" 68} 69 70ohos_shared_library("net_conn_manager_if") { 71 sources = [ 72 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_conn_client.cpp", 73 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_handle.cpp", 74 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/net_supplier_callback_base.cpp", 75 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_conn_callback_stub.cpp", 76 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_conn_service_proxy.cpp", 77 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_detection_callback_stub.cpp", 78 "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_supplier_callback_stub.cpp", 79 ] 80 81 include_dirs = [ 82 "$INNERKITS_ROOT/netmanagernative/include", 83 "$NETMANAGERNATIVE_ROOT/fwmarkclient/include", 84 "$NETMANAGER_BASE_ROOT/utils/log/include", 85 "//third_party/musl/porting/linux/user/src/hook", 86 ] 87 88 public_configs = [ ":net_conn_manager_if_config" ] 89 90 deps = [ 91 ":net_conn_parcel", 92 "$NETMANAGER_BASE_ROOT/services/netmanagernative/fwmarkclient:fwmark_client", 93 ] 94 95 external_deps = [ 96 "ipc:ipc_core", 97 "samgr:samgr_proxy", 98 ] 99 100 defines = [ 101 "NETMGR_LOG_TAG = \"NetConnManager\"", 102 "LOG_DOMAIN = 0xD0015B0", 103 ] 104 105 if (enable_netmgr_debug) { 106 defines += [ "NETMGR_DEBUG" ] 107 } 108 109 if (is_standard_system) { 110 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 111 } else { 112 external_deps += [ "hilog:libhilog" ] 113 } 114 115 part_name = "netmanager_base" 116 subsystem_name = "communication" 117} 118