• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/net/bluetooth/net_bluetooth.gni")
16import("//foundation/communication/dsoftbus/dsoftbus.gni")
17
18native_source_path = rebase_path("$dsoftbus_root_path")
19conn_ble_dir = "dsoftbus_enhance/core/connection/ble/src"
20enhanced_conn_ble = exec_script("$dsoftbus_root_path/check_sub_module.py",
21                                [
22                                  "$native_source_path",
23                                  "$conn_ble_dir",
24                                ],
25                                "value")
26conn_coc_dir = "dsoftbus_enhance/core/connection/coc"
27enhanced_conn_coc = exec_script("$dsoftbus_root_path/check_sub_module.py",
28                                [
29                                  "$native_source_path",
30                                  "$conn_coc_dir",
31                                ],
32                                "value")
33ble_connection_external_deps = []
34if (!support_bluetooth) {
35  ble_connection_src = [
36    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c",
37    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_virtual.c",
38  ]
39  ble_connection_inc = [
40    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
41    "$dsoftbus_root_path/core/connection/ble/include",
42    "$dsoftbus_root_path/core/common/include",
43  ]
44} else {
45  if (!dsoftbus_feature_conn_ble) {
46    ble_connection_src = [
47      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c",
48      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_virtual.c",
49    ]
50    ble_connection_inc = [
51      "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
52      "$dsoftbus_root_path/core/connection/ble/include",
53      "$dsoftbus_root_path/core/common/include",
54    ]
55    if (dsoftbus_feature_conn_br) {
56      ble_connection_src += adapter_net_br_src
57      ble_connection_inc += adapter_ble_inc
58      ble_connection_external_deps += adapter_ble_external_deps
59    }
60  } else {
61    ble_connection_src = [
62      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_client.c",
63      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
64      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c",
65      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_send_queue.c",
66      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_server.c",
67      "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_trans.c",
68    ]
69    ble_connection_inc = [
70      "$dsoftbus_root_path/core/connection/ble/include",
71      "$dsoftbus_root_path/core/connection/ble/src",
72      "$dsoftbus_root_path/core/common/include",
73    ]
74    if (enhanced_conn_ble == true) {
75      ble_connection_src += [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/ble/src/softbus_conn_ble_direct_conn.c" ]
76      ble_connection_inc +=
77          [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/ble/include" ]
78    } else {
79      ble_connection_src += [ "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c" ]
80    }
81    if (enhanced_conn_coc == true) {
82      ble_connection_src += [
83        "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/ble_protocol_interface_factory.c",
84        "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/softbus_adapter_coc.c",
85        "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/softbus_conn_ble_coc.c",
86      ]
87      ble_connection_inc +=
88          [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/include" ]
89    } else {
90      ble_connection_src += [ "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c" ]
91    }
92    ble_connection_src += adapter_ble_src
93    ble_connection_inc += adapter_ble_inc
94    ble_connection_external_deps += adapter_ble_external_deps
95  }
96}
97