• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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("//foundation/communication/dsoftbus/dsoftbus.gni")
15
16adapter_bus_center_path = "$softbus_adapter_common/bus_center"
17
18bus_center_adapter_src = []
19bus_center_adapter_inc = [ "$softbus_adapter_common/bus_center/include" ]
20bus_center_adapter_deps = []
21
22if (!defined(global_parts_info) ||
23    defined(global_parts_info.notification_common_event_service)) {
24  has_ces_part = true
25} else {
26  has_ces_part = false
27}
28
29if (defined(ohos_lite)) {
30  if (ohos_kernel_type == "liteos_m") {
31    if (dsoftbus_feature_lnn_net) {
32      bus_center_adapter_src += [
33        "$adapter_bus_center_path/driver/lnn_driver_monitor_virtual.c",
34        "$adapter_bus_center_path/driver/lnn_driver_request_virtual.c",
35        "$adapter_bus_center_path/network/lnn_linkwatch_virtual.c",
36        "$adapter_bus_center_path/network/lnn_lwip_monitor.c",
37        "$adapter_bus_center_path/network/lnn_netlink_monitor_virtual.c",
38        "$adapter_bus_center_path/platform/lnn_product_monitor_virtual.c",
39        "$adapter_bus_center_path/common_event/lnn_common_event_monitor_virtual.cpp",
40        "$adapter_bus_center_path/wlan/lnn_wifiservice_monitor_virtual.cpp",
41      ]
42    }
43  } else if (ohos_kernel_type == "linux") {
44    if (dsoftbus_feature_lnn_net) {
45      bus_center_adapter_src += [
46        "$adapter_bus_center_path/driver/lnn_driver_monitor_virtual.c",
47        "$adapter_bus_center_path/driver/lnn_driver_request_virtual.c",
48        "$adapter_bus_center_path/network/lnn_linkwatch.c",
49        "$adapter_bus_center_path/network/lnn_lwip_monitor_virtual.c",
50        "$adapter_bus_center_path/network/lnn_netlink_monitor.c",
51        "$adapter_bus_center_path/platform/lnn_product_monitor_virtual.c",
52        "$adapter_bus_center_path/common_event/lnn_common_event_monitor_virtual.cpp",
53        "$adapter_bus_center_path/wlan/lnn_wifiservice_monitor_virtual.cpp",
54      ]
55    }
56  } else if (ohos_kernel_type == "liteos_a") {
57    bus_center_adapter_inc += [
58      "//drivers/hdf_core/adapter/uhdf/posix/include",
59      "//drivers/hdf_core/framework/include/utils",
60      "//drivers/hdf_core/framework/include/core",
61      "//drivers/hdf_core/framework/ability/sbuf/include",
62    ]
63    if (dsoftbus_feature_lnn_net) {
64      bus_center_adapter_src += [
65        "$adapter_bus_center_path/driver/lnn_hdf_driver_monitor.c",
66        "$adapter_bus_center_path/driver/lnn_hdf_driver_request.c",
67        "$adapter_bus_center_path/network/lnn_linkwatch_virtual.c",
68        "$adapter_bus_center_path/network/lnn_lwip_monitor_virtual.c",
69        "$adapter_bus_center_path/network/lnn_netlink_monitor_virtual.c",
70        "$adapter_bus_center_path/platform/lnn_product_monitor.c",
71        "$adapter_bus_center_path/common_event/lnn_common_event_monitor_virtual.cpp",
72        "$adapter_bus_center_path/wlan/lnn_wifiservice_monitor_virtual.cpp",
73      ]
74      bus_center_adapter_inc += [
75        "//drivers/hdf_core/framework/core/shared/include",
76        "//drivers/hdf_core/framework/include",
77      ]
78      bus_center_adapter_deps += [
79        "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
80        "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform",
81        "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
82      ]
83    }
84  }
85} else {
86  bus_center_adapter_external_deps = []
87  if (has_ces_part) {
88    bus_center_adapter_src +=
89        [ "$adapter_bus_center_path/common_event/lnn_common_event_monitor.cpp" ]
90    bus_center_adapter_external_deps +=
91        [ "common_event_service:cesfwk_innerkits" ]
92  } else {
93    bus_center_adapter_src += [ "$adapter_bus_center_path/common_event/lnn_common_event_monitor_virtual.cpp" ]
94  }
95  if (dsoftbus_feature_lnn_net) {
96    bus_center_adapter_src += [
97      "$adapter_bus_center_path/driver/lnn_driver_monitor_virtual.c",
98      "$adapter_bus_center_path/driver/lnn_driver_request_virtual.c",
99      "$adapter_bus_center_path/network/lnn_linkwatch.c",
100      "$adapter_bus_center_path/network/lnn_lwip_monitor_virtual.c",
101      "$adapter_bus_center_path/network/lnn_netlink_monitor.c",
102      "$adapter_bus_center_path/platform/lnn_product_monitor_virtual.c",
103    ]
104    if (dsoftbus_feature_lnn_wifiservice_dependence && has_ces_part) {
105      bus_center_adapter_src +=
106          [ "$adapter_bus_center_path/wlan/lnn_wifiservice_monitor.cpp" ]
107      bus_center_adapter_inc += [
108        "//base/notification/common_event_service/interfaces/inner_api",
109        "//foundation/communication/wifi/wifi/interfaces/innerkits/native_cpp/wifi_standard/interfaces",
110        "//foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/common/net_helper",
111        "//foundation/communication/wifi/wifi/frameworks/native/interfaces",
112        "//foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper",
113      ]
114      bus_center_adapter_deps += []
115    } else {
116      bus_center_adapter_src += [
117        "$adapter_bus_center_path/wlan/lnn_wifiservice_monitor_virtual.cpp",
118      ]
119    }
120  }
121}
122
123if (dsoftbus_feature_lnn_net) {
124  if (dsoftbus_feature_conn_br || dsoftbus_feature_conn_ble) {
125    bus_center_adapter_src +=
126        [ "$adapter_bus_center_path/network/lnn_bt_monitor.c" ]
127    bus_center_adapter_inc += [
128      "$softbus_adapter_common/net/bluetooth/include",
129      "//foundation/communication/wifi/wifi/frameworks/native/interfaces",
130    ]
131  } else {
132    bus_center_adapter_src +=
133        [ "$adapter_bus_center_path/network/lnn_bt_monitor_virtual.c" ]
134  }
135}
136