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