• 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(
15    "//foundation/communication/dsoftbus/adapter/common/bus_center/bus_center_adapter.gni")
16import("//foundation/communication/dsoftbus/adapter/common/net/hdi/net_hdi.gni")
17import(
18    "//foundation/communication/dsoftbus/adapter/common/net/wifi/net_wifi.gni")
19import("//foundation/communication/dsoftbus/core/adapter/core_adapter.gni")
20import(
21    "//foundation/communication/dsoftbus/core/bus_center/lnn/decision_center/decision_center.gni")
22import(
23    "//foundation/communication/dsoftbus/core/bus_center/lnn/disc_mgr/bus_center_disc_mgr.gni")
24import(
25    "//foundation/communication/dsoftbus/core/bus_center/lnn/lane_hub/lane_hub.gni")
26import(
27    "//foundation/communication/dsoftbus/core/bus_center/lnn/net_builder/net_builder.gni")
28import(
29    "//foundation/communication/dsoftbus/core/bus_center/lnn/net_buscenter/net_manager.gni")
30import(
31    "//foundation/communication/dsoftbus/core/bus_center/lnn/net_ledger/net_ledger.gni")
32import(
33    "//foundation/communication/dsoftbus/core/bus_center/monitor/bus_center_monitor.gni")
34import(
35    "//foundation/communication/dsoftbus/core/bus_center/utils/bus_center_utils.gni")
36
37bus_center_server_src =
38    bus_center_adapter_src + bus_center_core_adapter_src +
39    bus_center_disc_mgr_src + bus_center_hub_src + bus_center_builder_src +
40    bus_center_net_mgr_src + bus_center_ledger_src + bus_center_monitor_src +
41    bus_center_utils_src + adapter_wifi_src + adapter_hdi_src +
42    bus_center_decision_center_src
43bus_center_server_inc =
44    bus_center_adapter_inc + bus_center_core_adapter_inc +
45    bus_center_disc_mgr_inc + bus_center_hub_inc + bus_center_builder_inc +
46    bus_center_net_mgr_inc + bus_center_ledger_inc + bus_center_monitor_inc +
47    bus_center_utils_inc + adapter_wifi_inc + adapter_hdi_inc +
48    bus_center_decision_center_inc
49bus_center_server_deps =
50    bus_center_adapter_deps + bus_center_core_adapter_deps +
51    bus_center_disc_mgr_deps + bus_center_hub_deps + bus_center_builder_deps +
52    bus_center_net_mgr_deps + bus_center_ledger_deps + bus_center_monitor_deps +
53    bus_center_utils_deps + bus_center_decision_center_deps
54
55bus_center_server_src +=
56    [ "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c" ]
57bus_center_server_src +=
58    [ "$dsoftbus_root_path/core/bus_center/service/src/bus_center_event.c" ]
59
60bus_center_server_inc += [
61  "$dsoftbus_root_path/core/bus_center/interface",
62  "$dsoftbus_root_path/core/bus_center/ipc/include",
63  "$dsoftbus_root_path/core/bus_center/service/include",
64  "$dsoftbus_root_path/sdk/bus_center/manager/include",
65  "$softbus_adapter_common/dfx/include",
66]
67
68bus_center_server_external_deps = []
69
70if (defined(global_parts_info) &&
71    defined(global_parts_info.hiviewdfx_hicollie_native)) {
72  bus_center_server_src +=
73      [ "$softbus_adapter_common/dfx/softbus_adapter_xcollie.cpp" ]
74  bus_center_server_external_deps += [ "hicollie_native:libhicollie" ]
75} else {
76  bus_center_server_src +=
77      [ "$softbus_adapter_common/dfx/softbus_adapter_xcollie_virtual.cpp" ]
78}
79
80if (defined(ohos_lite)) {
81  if (ohos_kernel_type == "liteos_m") {
82    bus_center_server_src +=
83        [ "$dsoftbus_root_path/core/bus_center/ipc/mini/lnn_bus_center_ipc.c" ]
84  } else {
85    bus_center_server_src += [
86      "$dsoftbus_root_path/core/bus_center/ipc/small/src/bus_center_client_proxy.c",
87      "$dsoftbus_root_path/core/bus_center/ipc/small/src/lnn_bus_center_ipc.c",
88    ]
89    bus_center_server_inc +=
90        [ "$dsoftbus_root_path/core/bus_center/ipc/small/include" ]
91    bus_center_server_deps += [
92      "//build/lite/config/component/cJSON:cjson_shared",
93      "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
94    ]
95  }
96} else {
97  bus_center_server_src += [
98    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/bus_center_client_proxy.cpp",
99    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/bus_center_client_proxy_standard.cpp",
100    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/src/lnn_bus_center_ipc.cpp",
101  ]
102  bus_center_server_inc += [
103    "$dsoftbus_root_path/core/bus_center/ipc/$os_type/include",
104    "$dsoftbus_root_path/sdk/frame/$os_type/include",
105    "//utils/system/safwk/native/include",
106  ]
107  bus_center_server_external_deps +=
108      bus_center_adapter_external_deps + bus_center_ledger_external_deps +
109      bus_center_core_adapter_external_deps + adapter_wifi_external_deps +
110      adapter_hdi_external_deps
111  bus_center_server_external_deps += [ "c_utils:utils" ]
112}
113
114native_source_path = rebase_path("$dsoftbus_root_path")
115agcr_dir = "dsoftbus_enhance/components/newip/agcr"
116agcr_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
117                            [
118                              "$native_source_path",
119                              "$agcr_dir",
120                            ],
121                            "value")
122
123if (agcr_enhanced) {
124  import(
125      "//foundation/communication/dsoftbus/dsoftbus_enhance/components/newip/agcr/agcr.gni")
126
127  bus_center_server_src += agcr_src
128  bus_center_server_inc += agcr_inc
129}
130
131route_dir = "dsoftbus_enhance/components/newip/route"
132route_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
133                             [
134                               "$native_source_path",
135                               "$route_dir",
136                             ],
137                             "value")
138
139if (route_enhanced) {
140  import(
141      "//foundation/communication/dsoftbus/dsoftbus_enhance/components/newip/route/route.gni")
142
143  bus_center_server_src += route_src
144  bus_center_server_inc += route_inc
145}
146
147btn_dir = "dsoftbus_enhance/components/newip/btn"
148btn_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
149                           [
150                             "$native_source_path",
151                             "$btn_dir",
152                           ],
153                           "value")
154
155if (btn_enhanced) {
156  import(
157      "//foundation/communication/dsoftbus/dsoftbus_enhance/components/newip/btn/btn.gni")
158
159  bus_center_server_src += btn_src
160  bus_center_server_inc += btn_inc
161}
162