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/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17group("common_target") { 18 deps = [ 19 ":net_bundle_utils", 20 ":net_data_share", 21 ":net_manager_common", 22 "napi_utils:napi_utils", 23 ] 24} 25 26config("netmgr_common_config") { 27 include_dirs = [ 28 "bundle_utils/include", 29 "common_utils/include", 30 "errorcode_utils/include", 31 "$INNERKITS_ROOT/include", 32 "$INNERKITS_ROOT/netconnclient/include", 33 "$INNERKITS_ROOT/netpolicyclient/include", 34 "$INNERKITS_ROOT/netstatsclient/include", 35 ] 36 37 cflags = common_cflags 38 39 cflags_cc = common_cflags 40} 41 42ohos_shared_library("net_manager_common") { 43 sanitize = { 44 cfi = true 45 cfi_cross_dso = true 46 debug = false 47 } 48 49 branch_protector_ret = "pac_ret" 50 51 sources = [ 52 "common_utils/src/base64_utils.cpp", 53 "common_utils/src/event_report.cpp", 54 "common_utils/src/netmanager_base_common_utils.cpp", 55 "common_utils/src/netmanager_base_permission.cpp", 56 "common_utils/src/netmanager_hitrace.cpp", 57 "common_utils/src/tiny_count_down_latch.cpp", 58 "common_utils/src/system_timer.cpp", 59 "errorcode_utils/src/errorcode_convertor.cpp", 60 ] 61 62 defines = [ 63 "NETMGR_LOG_TAG = \"NetMgrCommon\"", 64 "LOG_DOMAIN = 0xD0015B0", 65 ] 66 67 if (enable_netmgr_debug) { 68 defines += [ "NETMGR_DEBUG" ] 69 } 70 71 if (netmanager_base_enable_feature_wearable_distributed_net) { 72 defines += [ "FEATURE_WEARABLE_DISTRIBUTED_NET_ENABLE" ] 73 } 74 75 if (is_standard_system) { 76 defines += [ "STANDARD_SYSTEM_ENABLE" ] 77 } 78 79 public_configs = [ ":netmgr_common_config" ] 80 81 external_deps = [ 82 "hicollie:libhicollie", 83 "hilog:libhilog", 84 "init:libbegetutil", 85 ] 86 87 external_deps += [ 88 "access_token:libaccesstoken_sdk", 89 "access_token:libtokenid_sdk", 90 "c_utils:utils", 91 "hisysevent:libhisysevent", 92 "hitrace:hitrace_meter", 93 "ipc:ipc_single", 94 "ability_runtime:wantagent_innerkits", 95 "time_service:time_client", 96 "faultloggerd:libbacktrace_local" 97 ] 98 99 innerapi_tags = [ "platformsdk" ] 100 part_name = "netmanager_base" 101 subsystem_name = "communication" 102} 103 104config("netmgr_datashare_config") { 105 include_dirs = [ 106 "data_share/include", 107 "common_utils/include", 108 "$INNERKITS_ROOT/include", 109 ] 110 111 cflags = common_cflags 112 113 cflags_cc = common_cflags 114} 115 116ohos_shared_library("net_data_share") { 117 sanitize = { 118 cfi = true 119 cfi_cross_dso = true 120 debug = false 121 } 122 123 branch_protector_ret = "pac_ret" 124 125 include_dirs = [ 126 "common_utils/include", 127 ] 128 129 sources = [ 130 "data_share/src/net_datashare_utils.cpp", 131 "data_share/src/net_datashare_utils_iface.cpp", 132 ] 133 134 defines = [ 135 "NETMGR_LOG_TAG = \"NetMgrDataShare\"", 136 "LOG_DOMAIN = 0xD0015B0", 137 ] 138 139 if (enable_netmgr_debug) { 140 defines += [ "NETMGR_DEBUG" ] 141 } 142 143 if (is_standard_system) { 144 defines += [ "STANDARD_SYSTEM_ENABLE" ] 145 } 146 147 public_configs = [ ":netmgr_datashare_config" ] 148 149 external_deps = [ 150 "ability_base:zuri", 151 "ability_runtime:dataobs_manager", 152 "c_utils:utils", 153 "data_share:datashare_common", 154 "data_share:datashare_consumer", 155 "hilog:libhilog", 156 "ipc:ipc_core", 157 "samgr:samgr_proxy", 158 ] 159 160 innerapi_tags = [ "platformsdk" ] 161 part_name = "netmanager_base" 162 subsystem_name = "communication" 163} 164 165ohos_shared_library("net_bundle_utils") { 166 sanitize = { 167 cfi = true 168 cfi_cross_dso = true 169 debug = false 170 blocklist = "./bundle_utils/net_bundle_utils_blocklist.txt" 171 } 172 173 branch_protector_ret = "pac_ret" 174 175 include_dirs = [ 176 "bundle_utils/include", 177 "common_utils/include", 178 "$INNERKITS_ROOT/include", 179 ] 180 181 sources = [ "bundle_utils/src/net_bundle_impl.cpp" ] 182 183 defines = [ 184 "NETMGR_LOG_TAG = \"NetMgrBundleUtils\"", 185 "LOG_DOMAIN = 0xD0015B0", 186 ] 187 188 cflags = common_cflags 189 190 cflags_cc = common_cflags 191 192 if (enable_netmgr_debug) { 193 defines += [ "NETMGR_DEBUG" ] 194 } 195 196 if (is_standard_system) { 197 defines += [ "STANDARD_SYSTEM_ENABLE" ] 198 } 199 200 external_deps = [ 201 "bundle_framework:appexecfwk_base", 202 "bundle_framework:appexecfwk_core", 203 "c_utils:utils", 204 "hilog:libhilog", 205 "ipc:ipc_core", 206 "os_account:os_account_innerkits", 207 "samgr:samgr_proxy", 208 ] 209 210 innerapi_tags = [ "platformsdk" ] 211 part_name = "netmanager_base" 212 subsystem_name = "communication" 213} 214