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 "common_utils/include", 29 "log/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 = [ 38 "-fstack-protector-strong", 39 "-D_FORTIFY_SOURCE=2", 40 "-O2", 41 ] 42 43 cflags_cc = [ 44 "-fstack-protector-strong", 45 "-D_FORTIFY_SOURCE=2", 46 "-O2", 47 ] 48} 49 50ohos_shared_library("net_manager_common") { 51 sanitize = { 52 cfi = true 53 cfi_cross_dso = true 54 debug = false 55 } 56 57 sources = [ 58 "common_utils/src/base64_utils.cpp", 59 "common_utils/src/event_report.cpp", 60 "common_utils/src/netmanager_base_common_utils.cpp", 61 "common_utils/src/netmanager_base_permission.cpp", 62 "common_utils/src/netmanager_hitrace.cpp", 63 "errorcode_utils/src/errorcode_convertor.cpp", 64 "log/src/net_mgr_log_wrapper.cpp", 65 ] 66 67 defines = [ 68 "NETMGR_LOG_TAG = \"NetMgrCommon\"", 69 "LOG_DOMAIN = 0xD0015B0", 70 ] 71 72 if (enable_netmgr_debug) { 73 defines += [ "NETMGR_DEBUG" ] 74 } 75 76 if (is_standard_system) { 77 defines += [ "STANDARD_SYSTEM_ENABLE" ] 78 } 79 80 public_configs = [ 81 ":netmgr_common_config", 82 "$C_UTILS_ROOT/base:utils_config", 83 ] 84 85 external_deps = [ "hilog:libhilog" ] 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 ] 95 96 innerapi_tags = [ "platformsdk" ] 97 part_name = "netmanager_base" 98 subsystem_name = "communication" 99} 100 101config("netmgr_datashare_config") { 102 include_dirs = [ 103 "data_share/include", 104 "log/include", 105 "$INNERKITS_ROOT/include", 106 ] 107 108 cflags = [ 109 "-fstack-protector-strong", 110 "-D_FORTIFY_SOURCE=2", 111 "-O2", 112 ] 113 114 cflags_cc = [ 115 "-fstack-protector-strong", 116 "-D_FORTIFY_SOURCE=2", 117 "-O2", 118 ] 119} 120 121ohos_shared_library("net_data_share") { 122 sanitize = { 123 cfi = true 124 cfi_cross_dso = true 125 debug = false 126 } 127 128 sources = [ 129 "data_share/src/net_datashare_utils.cpp", 130 "data_share/src/net_datashare_utils_iface.cpp", 131 ] 132 133 defines = [ 134 "NETMGR_LOG_TAG = \"NetMgrDataShare\"", 135 "LOG_DOMAIN = 0xD0015B0", 136 ] 137 138 if (enable_netmgr_debug) { 139 defines += [ "NETMGR_DEBUG" ] 140 } 141 142 if (is_standard_system) { 143 defines += [ "STANDARD_SYSTEM_ENABLE" ] 144 } 145 146 public_configs = [ ":netmgr_datashare_config" ] 147 148 external_deps = [ 149 "ability_base:zuri", 150 "c_utils:utils", 151 "data_share:datashare_common", 152 "data_share:datashare_consumer", 153 "hilog:libhilog", 154 "samgr:samgr_proxy", 155 ] 156 157 innerapi_tags = [ "platformsdk" ] 158 part_name = "netmanager_base" 159 subsystem_name = "communication" 160} 161 162ohos_shared_library("net_bundle_utils") { 163 sanitize = { 164 cfi = true 165 cfi_cross_dso = true 166 debug = false 167 } 168 169 include_dirs = [ 170 "bundle_utils/include", 171 "log/include", 172 "$INNERKITS_ROOT/include", 173 ] 174 175 sources = [ "bundle_utils/src/net_bundle_impl.cpp" ] 176 177 defines = [ 178 "NETMGR_LOG_TAG = \"NetMgrBundleUtils\"", 179 "LOG_DOMAIN = 0xD0015B0", 180 ] 181 182 if (enable_netmgr_debug) { 183 defines += [ "NETMGR_DEBUG" ] 184 } 185 186 if (is_standard_system) { 187 defines += [ "STANDARD_SYSTEM_ENABLE" ] 188 } 189 190 external_deps = [ 191 "bundle_framework:appexecfwk_base", 192 "bundle_framework:appexecfwk_core", 193 "c_utils:utils", 194 "hilog:libhilog", 195 "ipc:ipc_core", 196 "samgr:samgr_proxy", 197 ] 198 199 part_name = "netmanager_base" 200 subsystem_name = "communication" 201} 202