1# Copyright (c) 2021-2024 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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") 17 18config("net_conn_manager_if_config") { 19 # header file path 20 include_dirs = [ 21 "${target_gen_dir}", 22 "include", 23 "include/proxy", 24 "$EXT_INNERKITS_ROOT/include", 25 ] 26 27 cflags = [] 28 if (is_double_framework) { 29 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 30 } 31 if (target_cpu == "arm") { 32 cflags += [ "-DBINDER_IPC_32BIT" ] 33 } 34 if (is_standard_system) { 35 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 36 } 37 if (defined(build_public_version) && build_public_version) { 38 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 39 } 40 41 cflags += common_cflags 42 43 cflags_cc = common_cflags 44} 45 46ohos_static_library("ethernet_parcel") { 47 sanitize = { 48 cfi = true 49 cfi_cross_dso = true 50 debug = false 51 } 52 53 branch_protector_ret = "pac_ret" 54 55 sources = [ 56 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/configuration_parcel_ipc.cpp", 57 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/interface_configuration.cpp", 58 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/mac_address_info.cpp", 59 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/eap_data.cpp", 60 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/static_configuration.cpp", 61 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/ethernet_device_info.cpp", 62 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/eth_eap_profile.cpp", 63 ] 64 65 include_dirs = [ 66 "$EXT_INNERKITS_ROOT/include", 67 "$EXT_INNERKITS_ROOT/ethernetclient/include", 68 ] 69 70 external_deps = [ 71 "c_utils:utils", 72 "netmanager_base:net_conn_manager_if", 73 "netmanager_base:net_manager_common", 74 "netmanager_base:net_native_manager_if", 75 ] 76 77 external_deps += [ "hilog:libhilog" ] 78 79 part_name = "netmanager_ext" 80 subsystem_name = "communication" 81} 82 83idl_gen_interface("ethernet_service_interface") { 84 sources = [ "IEthernetService.idl" ] 85} 86 87config("ethernet_service_interface_stub_config") { 88 include_dirs = [ 89 "${target_gen_dir}", 90 "include", 91 "include/proxy", 92 "$EXT_INNERKITS_ROOT/include", 93 ] 94} 95 96ohos_static_library("ethernet_service_interface_stub") { 97 sanitize = { 98 cfi = true 99 cfi_cross_dso = true 100 debug = false 101 } 102 public_configs = [ ":ethernet_service_interface_stub_config" ] 103 output_values = get_target_outputs(":ethernet_service_interface") 104 sources = [] 105 sources += filter_include(output_values, [ "*ice_stub.cpp" ]) 106 deps = [ ":ethernet_service_interface" ] 107 external_deps = [ 108 "hilog:libhilog", 109 "ipc:ipc_single", 110 "netmanager_base:net_manager_common", 111 "netmanager_base:net_native_manager_if", 112 "samgr:samgr_proxy", 113 "c_utils:utils", 114 ] 115 part_name = "netmanager_ext" 116 subsystem_name = "communication" 117} 118 119ohos_shared_library("ethernet_manager_if") { 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 = [ "$EXT_INNERKITS_ROOT/include" ] 129 130 sources = [ 131 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/ethernet_client.cpp", 132 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_eap_callback_stub.cpp", 133 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp", 134 "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp", 135 ] 136 137 output_values = get_target_outputs(":ethernet_service_interface") 138 sources += filter_include(output_values, [ "*ice_proxy.cpp" ]) 139 140 version_script = "libethernet_kits.map" 141 142 public_configs = [ ":net_conn_manager_if_config" ] 143 144 deps = [ ":ethernet_parcel" ] 145 deps += [ ":ethernet_service_interface" ] 146 147 external_deps = [ 148 "bounds_checking_function:libsec_shared", 149 "ipc:ipc_single", 150 "netmanager_base:net_manager_common", 151 "samgr:samgr_proxy", 152 ] 153 154 public_external_deps = [ 155 "netmanager_base:net_manager_common", 156 "netmanager_base:net_native_manager_if", 157 ] 158 159 defines = [ 160 "NETMGR_LOG_TAG = \"EthernetManager\"", 161 "LOG_DOMAIN = 0xD0015B0", 162 ] 163 164 if (enable_netmgr_ext_debug) { 165 defines += [ "NETMGR_DEBUG" ] 166 } 167 168 if (netmanager_ext_extensible_authentication) { 169 defines += [ "NET_EXTENSIBLE_AUTHENTICATION" ] 170 } 171 172 external_deps += [ "hilog:libhilog" ] 173 174 innerapi_tags = [ "platformsdk" ] 175 part_name = "netmanager_ext" 176 subsystem_name = "communication" 177} 178