1# Copyright (c) 2022-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/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17ohos_shared_library("connection") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 boundary_sanitize = true 22 all_ubsan = true 23 debug = false 24 } 25 26 branch_protector_ret = "pac_ret" 27 28 include_dirs = [ 29 "async_context/include", 30 "async_work/include", 31 "constant/include", 32 "connection_exec/include", 33 "connection_module/include", 34 "observer/include", 35 "options/include", 36 ] 37 38 sources = [ "connection_module/src/connection_module.cpp" ] 39 40 cflags = [ 41 "-fstack-protector-strong", 42 "-D_FORTIFY_SOURCE=2", 43 "-O2", 44 ] 45 46 cflags_cc = [ 47 "-fstack-protector-strong", 48 "-D_FORTIFY_SOURCE=2", 49 "-O2", 50 ] 51 52 deps = [ 53 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 54 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection:connection_if", 55 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 56 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 57 ] 58 external_deps = [ 59 "c_utils:utils", 60 "hilog:libhilog", 61 "ipc:ipc_core", 62 "napi:ace_napi", 63 ] 64 65 if (product_name != "qemu-arm-linux-min") { 66 external_deps += [ "hiappevent:hiappevent_innerapi" ] 67 } 68 69 relative_install_dir = "module/net" 70 part_name = "netmanager_base" 71 subsystem_name = "communication" 72} 73 74ohos_shared_library("connection_if") { 75 sanitize = { 76 cfi = true 77 cfi_cross_dso = true 78 boundary_sanitize = true 79 ubsan = true 80 debug = false 81 } 82 83 branch_protector_ret = "pac_ret" 84 85 include_dirs = [ 86 "async_context/include", 87 "async_work/include", 88 "constant/include", 89 "connection_exec/include", 90 "net_handle_interface/include", 91 "observer/include", 92 "options/include", 93 ] 94 95 sources = [ 96 "async_context/src/addnetworkroute_context.cpp", 97 "async_context/src/bindsocket_context.cpp", 98 "async_context/src/deletecustomdnsrule_context.cpp", 99 "async_context/src/deletecustomdnsrules_context.cpp", 100 "async_context/src/factoryresetnetwork_context.cpp", 101 "async_context/src/getaddressbyname_context.cpp", 102 "async_context/src/getappnet_context.cpp", 103 "async_context/src/getdefaultnet_context.cpp", 104 "async_context/src/gethttpproxy_context.cpp", 105 "async_context/src/getinterfaceconfig_context.cpp", 106 "async_context/src/interfaceregister_context.cpp", 107 "async_context/src/none_params_context.cpp", 108 "async_context/src/pacurl_context.cpp", 109 "async_context/src/parse_nethandle_context.cpp", 110 "async_context/src/register_context.cpp", 111 "async_context/src/registernetsupplier_context.cpp", 112 "async_context/src/setappnet_context.cpp", 113 "async_context/src/setcustomdnsrule_context.cpp", 114 "async_context/src/setglobalhttpproxy_context.cpp", 115 "async_context/src/setinterfaceipaddr_context.cpp", 116 "async_context/src/setinterfaceup_context.cpp", 117 "async_context/src/unregisternetsupplier_context.cpp", 118 "async_context/src/netextattribute_context.cpp", 119 "async_work/src/connection_async_work.cpp", 120 "connection_exec/src/connection_exec.cpp", 121 "net_handle_interface/src/net_handle_interface.cpp", 122 "observer/src/net_conn_callback_observer.cpp", 123 "observer/src/net_interface_callback_observer.cpp", 124 "options/src/net_address.cpp", 125 "options/src/netconnection.cpp", 126 "options/src/netinterface.cpp", 127 ] 128 129 cflags = [ 130 "-fstack-protector-strong", 131 "-D_FORTIFY_SOURCE=2", 132 "-O2", 133 ] 134 135 cflags_cc = [ 136 "-fstack-protector-strong", 137 "-D_FORTIFY_SOURCE=2", 138 "-O2", 139 ] 140 141 deps = [ 142 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 143 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 144 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 145 ] 146 external_deps = [ 147 "c_utils:utils", 148 "hilog:libhilog", 149 "ipc:ipc_core", 150 "napi:ace_napi", 151 "samgr:samgr_proxy", 152 ] 153 154 if (product_name != "qemu-arm-linux-min") { 155 external_deps += [ "hiappevent:hiappevent_innerapi" ] 156 } 157 158 part_name = "netmanager_base" 159 subsystem_name = "communication" 160} 161