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 "$NETMANAGER_BASE_ROOT/utils/log/include", 37 "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", 38 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 39 ] 40 41 sources = [ "connection_module/src/connection_module.cpp" ] 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 deps = [ 56 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 57 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection:connection_if", 58 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 59 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 60 ] 61 external_deps = [ 62 "c_utils:utils", 63 "hilog:libhilog", 64 "ipc:ipc_core", 65 "napi:ace_napi", 66 ] 67 68 relative_install_dir = "module/net" 69 part_name = "netmanager_base" 70 subsystem_name = "communication" 71} 72 73ohos_shared_library("connection_if") { 74 sanitize = { 75 cfi = true 76 cfi_cross_dso = true 77 boundary_sanitize = true 78 ubsan = true 79 debug = false 80 } 81 82 branch_protector_ret = "pac_ret" 83 84 include_dirs = [ 85 "async_context/include", 86 "async_work/include", 87 "constant/include", 88 "connection_exec/include", 89 "net_handle_interface/include", 90 "observer/include", 91 "options/include", 92 "$NETMANAGER_BASE_ROOT/utils/log/include", 93 "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", 94 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 95 ] 96 97 sources = [ 98 "async_context/src/addnetworkroute_context.cpp", 99 "async_context/src/bindsocket_context.cpp", 100 "async_context/src/deletecustomdnsrule_context.cpp", 101 "async_context/src/deletecustomdnsrules_context.cpp", 102 "async_context/src/factoryresetnetwork_context.cpp", 103 "async_context/src/getaddressbyname_context.cpp", 104 "async_context/src/getappnet_context.cpp", 105 "async_context/src/getdefaultnet_context.cpp", 106 "async_context/src/gethttpproxy_context.cpp", 107 "async_context/src/getinterfaceconfig_context.cpp", 108 "async_context/src/interfaceregister_context.cpp", 109 "async_context/src/none_params_context.cpp", 110 "async_context/src/pacurl_context.cpp", 111 "async_context/src/parse_nethandle_context.cpp", 112 "async_context/src/register_context.cpp", 113 "async_context/src/registernetsupplier_context.cpp", 114 "async_context/src/setappnet_context.cpp", 115 "async_context/src/setcustomdnsrule_context.cpp", 116 "async_context/src/setglobalhttpproxy_context.cpp", 117 "async_context/src/setinterfaceipaddr_context.cpp", 118 "async_context/src/setinterfaceup_context.cpp", 119 "async_context/src/unregisternetsupplier_context.cpp", 120 "async_work/src/connection_async_work.cpp", 121 "connection_exec/src/connection_exec.cpp", 122 "net_handle_interface/src/net_handle_interface.cpp", 123 "observer/src/net_conn_callback_observer.cpp", 124 "observer/src/net_interface_callback_observer.cpp", 125 "options/src/net_address.cpp", 126 "options/src/netconnection.cpp", 127 "options/src/netinterface.cpp", 128 ] 129 130 cflags = [ 131 "-fstack-protector-strong", 132 "-D_FORTIFY_SOURCE=2", 133 "-O2", 134 ] 135 136 cflags_cc = [ 137 "-fstack-protector-strong", 138 "-D_FORTIFY_SOURCE=2", 139 "-O2", 140 ] 141 142 deps = [ 143 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 144 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 145 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 146 ] 147 external_deps = [ 148 "c_utils:utils", 149 "hilog:libhilog", 150 "ipc:ipc_core", 151 "napi:ace_napi", 152 "samgr:samgr_proxy", 153 ] 154 155 part_name = "netmanager_base" 156 subsystem_name = "communication" 157} 158