• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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("../../adapter/common/bus_center/bus_center_adapter.gni")
15import("../../adapter/common/net/hdi/net_hdi.gni")
16import("../../adapter/common/net/wifi/net_wifi.gni")
17import("../../core/adapter/core_adapter.gni")
18import("../../core/bus_center/lnn/decision_center/decision_center.gni")
19import("../../core/bus_center/lnn/disc_mgr/bus_center_disc_mgr.gni")
20import("../../core/bus_center/lnn/lane_hub/lane_hub.gni")
21import("../../core/bus_center/lnn/net_builder/net_builder.gni")
22import("../../core/bus_center/lnn/net_buscenter/net_manager.gni")
23import("../../core/bus_center/lnn/net_ledger/net_ledger.gni")
24import("../../core/bus_center/monitor/bus_center_monitor.gni")
25import("../../core/bus_center/utils/bus_center_utils.gni")
26
27bus_center_server_src =
28    bus_center_adapter_src + bus_center_core_adapter_src +
29    bus_center_disc_mgr_src + bus_center_hub_src + bus_center_builder_src +
30    bus_center_net_mgr_src + bus_center_ledger_src + bus_center_monitor_src +
31    bus_center_utils_src + adapter_wifi_src + adapter_hdi_src +
32    bus_center_decision_center_src
33bus_center_server_inc =
34    bus_center_adapter_inc + bus_center_core_adapter_inc +
35    bus_center_disc_mgr_inc + bus_center_hub_inc + bus_center_builder_inc +
36    bus_center_net_mgr_inc + bus_center_ledger_inc + bus_center_monitor_inc +
37    bus_center_utils_inc + adapter_wifi_inc + adapter_hdi_inc +
38    bus_center_decision_center_inc
39bus_center_server_deps =
40    bus_center_adapter_deps + bus_center_core_adapter_deps +
41    bus_center_disc_mgr_deps + bus_center_hub_deps + bus_center_builder_deps +
42    bus_center_net_mgr_deps + bus_center_ledger_deps + bus_center_monitor_deps +
43    bus_center_utils_deps + bus_center_decision_center_deps
44
45bus_center_server_src += [
46  "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c",
47  "$dsoftbus_root_path/core/bus_center/service/src/bus_center_event.c",
48  "$dsoftbus_root_path/core/bus_center/service/src/bus_center_decision_center.c",
49]
50
51bus_center_server_inc += [
52  "$dsoftbus_root_path/interface/kits/bus_center",
53  "$dsoftbus_root_path/core/bus_center/interface",
54  "$dsoftbus_root_path/core/bus_center/ipc/include",
55  "$dsoftbus_root_path/core/bus_center/service/include",
56  "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
57  "$dsoftbus_root_path/sdk/bus_center/manager/include",
58]
59
60bus_center_server_external_deps = []
61
62if (defined(global_parts_info) && defined(global_parts_info.hicollie)) {
63  bus_center_server_src +=
64      [ "$dsoftbus_dfx_path/watchdog/legacy/softbus_adapter_xcollie.cpp" ]
65  bus_center_server_external_deps += [ "hicollie:libhicollie" ]
66} else {
67  bus_center_server_src += [
68    "$dsoftbus_dfx_path/watchdog/legacy/softbus_adapter_xcollie_virtual.cpp",
69  ]
70}
71
72if (defined(ohos_lite)) {
73  if (ohos_kernel_type == "liteos_m") {
74    bus_center_server_src +=
75        [ "$dsoftbus_root_path/core/bus_center/ipc/mini/lnn_bus_center_ipc.c" ]
76  } else {
77    bus_center_server_src += [
78      "$dsoftbus_root_path/core/bus_center/ipc/small/src/bus_center_client_proxy.c",
79      "$dsoftbus_root_path/core/bus_center/ipc/small/src/lnn_bus_center_ipc.c",
80    ]
81    bus_center_server_inc +=
82        [ "$dsoftbus_root_path/core/bus_center/ipc/small/include" ]
83    bus_center_server_deps += [
84      "//build/lite/config/component/cJSON:cjson_shared",
85      "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
86    ]
87  }
88} else {
89  bus_center_server_src += [
90    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/bus_center_client_proxy.cpp",
91    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/bus_center_client_proxy_standard.cpp",
92    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/lnn_bus_center_ipc.cpp",
93  ]
94  bus_center_server_inc += [
95    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/include",
96    "$dsoftbus_root_path/sdk/frame/$os_type/include",
97  ]
98
99  if (dsoftbus_feature_ex_kits) {
100    import(
101        "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/extend/bus_center_ex.gni")
102
103    bus_center_server_inc += bus_center_ex_inc
104    bus_center_server_src += bus_center_ex_src
105  } else {
106    bus_center_server_inc +=
107        [ "$dsoftbus_root_path/core/bus_center/extend/include" ]
108    bus_center_server_src += [ "$dsoftbus_root_path/core/bus_center/extend/src/bus_center_ex_obj_stub.cpp" ]
109  }
110
111  bus_center_server_external_deps +=
112      bus_center_adapter_external_deps + bus_center_ledger_external_deps +
113      bus_center_core_adapter_external_deps + adapter_wifi_external_deps +
114      adapter_hdi_external_deps
115  bus_center_server_external_deps += [ "c_utils:utils" ]
116}
117
118native_source_path = rebase_path("$dsoftbus_root_path")
119agcr_dir = "dsoftbus_enhance/components/newip/agcr"
120agcr_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
121                            [
122                              "$native_source_path",
123                              "$agcr_dir",
124                            ],
125                            "value")
126
127if (agcr_enhanced) {
128  import("../../dsoftbus_enhance/components/newip/agcr/agcr.gni")
129
130  bus_center_server_src += agcr_src
131  bus_center_server_inc += agcr_inc
132}
133
134lnn_lp_dir = "dsoftbus_enhance/adapter/common/mlps/src"
135lnn_lp_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
136                              [
137                                "$native_source_path",
138                                "$lnn_lp_dir",
139                              ],
140                              "value")
141
142if (lnn_lp_enhanced) {
143  import("../../dsoftbus_enhance/adapter/common/mlps/adapter_mlps.gni")
144  bus_center_server_inc += adapter_mlps_inc
145  bus_center_server_src += adapter_mlps_src
146}
147
148lnn_lane_dir = "dsoftbus_enhance/core/bus_center/lnn/lane_hub/lane/src"
149lnn_lane_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
150                                [
151                                  "$native_source_path",
152                                  "$lnn_lane_dir",
153                                ],
154                                "value")
155
156if (lnn_lane_enhanced && dsoftbus_feature_lnn_lane_mgr) {
157  import("../../dsoftbus_enhance/core/bus_center/lnn/lane_hub/lane/lane.gni")
158  bus_center_server_src += bus_center_lane_enhance_src
159  bus_center_server_external_deps += bus_center_lane_enhance_external_deps
160}
161
162route_dir = "dsoftbus_enhance/components/newip/route"
163route_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
164                             [
165                               "$native_source_path",
166                               "$route_dir",
167                             ],
168                             "value")
169
170if (route_enhanced) {
171  import("../../dsoftbus_enhance/components/newip/route/route.gni")
172
173  bus_center_server_src += route_src
174  bus_center_server_inc += route_inc
175}
176
177btn_dir = "dsoftbus_enhance/components/newip/btn"
178btn_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
179                           [
180                             "$native_source_path",
181                             "$btn_dir",
182                           ],
183                           "value")
184
185if (btn_enhanced) {
186  import("../../dsoftbus_enhance/components/newip/btn/btn.gni")
187
188  bus_center_server_src += btn_src
189  bus_center_server_inc += btn_inc
190}
191
192meta_node_dir = "dsoftbus_enhance/core/bus_center/lnn/meta_node"
193meta_node_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
194                                 [
195                                   "$native_source_path",
196                                   "$meta_node_dir",
197                                 ],
198                                 "value")
199
200if (meta_node_enhanced) {
201  import(
202      "//foundation/communication/dsoftbus/dsoftbus_enhance/core/bus_center/lnn/meta_node/meta_node.gni")
203
204  bus_center_server_src += bus_center_meta_node_enhance_src
205  bus_center_server_inc += bus_center_meta_node_enhance_inc
206}
207if (!meta_node_enhanced || !dsoftbus_feature_lnn_meta_node) {
208  import(
209      "//foundation/communication/dsoftbus/core/bus_center/lnn/meta_node/meta_node.gni")
210
211  bus_center_server_src += bus_center_meta_node_src
212  bus_center_server_inc += bus_center_meta_node_inc
213}
214
215native_source_path = rebase_path("$dsoftbus_root_path")
216dep_linkfinder = "dsoftbus_enhance/core/bus_center/adapter"
217lk_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
218                          [
219                            "$native_source_path",
220                            "$dep_linkfinder",
221                          ],
222                          "value")
223
224if (lk_enhanced) {
225  import("../../dsoftbus_enhance/core/bus_center/adapter/adapter.gni")
226
227  bus_center_server_src += lnn_link_finder_sources
228  bus_center_server_inc += lnn_link_finder_include_dirs
229  bus_center_server_deps += lnn_link_finder_deps
230} else {
231  bus_center_server_src += [
232    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_link_finder_virtul.c",
233  ]
234  bus_center_server_inc +=
235      [ "$dsoftbus_root_path/core/adapter/bus_center/include" ]
236}
237
238lnn_coap_dep_dir = "dsoftbus_enhance/core/bus_center/lnn/disc_mgr"
239lnn_disc_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
240                                [
241                                  "$native_source_path",
242                                  "$lnn_coap_dep_dir",
243                                ],
244                                "value")
245
246if (dsoftbus_feature_lnn_frame && lnn_disc_enhanced) {
247  disc_mgr_enhance_path =
248      "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/disc_mgr"
249  bus_center_server_src += [ "$disc_mgr_enhance_path/src/lnn_coap_adapter.c" ]
250  bus_center_server_inc +=
251      [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coap" ]
252} else {
253  bus_center_server_src += [ "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/src/lnn_coap_adapter_virtual.c" ]
254}
255
256native_source_path = rebase_path("$dsoftbus_root_path")
257oobe_dir = "dsoftbus_enhance/adapter/common/oobe"
258oobe_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
259                            [
260                              "$native_source_path",
261                              "$oobe_dir",
262                            ],
263                            "value")
264
265if (!oobe_enhanced) {
266  bus_center_server_src += [ "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_oobe_manager_virtual.cpp" ]
267  bus_center_server_inc +=
268      [ "$dsoftbus_root_path/core/adapter/bus_center/include" ]
269} else {
270  bus_center_server_src += [ "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/oobe/lnn_oobe_manager.cpp" ]
271
272  bus_center_server_inc += [
273    "$dsoftbus_root_path/adapter/common/bus_center/include",
274    "$dsoftbus_root_path/core/adapter/bus_center/include",
275  ]
276}
277
278usb_channel_dir = "dsoftbus_enhance/core/bus_center/lnn/usb_channel_config/src"
279usb_channel_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
280                                   [
281                                     "$native_source_path",
282                                     "$usb_channel_dir",
283                                   ],
284                                   "value")
285
286if (usb_channel_enhanced) {
287  import(
288      "../../dsoftbus_enhance/core/bus_center/lnn/usb_channel_config/usb_channel.gni")
289
290  bus_center_server_inc += usb_channel_enhance_inc
291  bus_center_server_src += usb_channel_enhance_src
292  bus_center_server_external_deps += usb_channel_enhance_external_deps
293}
294