• 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("../../../dsoftbus.gni")
15import("../../common/dfx/dsoftbus_dfx.gni")
16
17native_source_path = rebase_path("$dsoftbus_root_path")
18disc_dep_dir = "dsoftbus_enhance/core/discovery/ble"
19disc_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
20                            [
21                              "$native_source_path",
22                              "$disc_dep_dir",
23                            ],
24                            "value")
25
26ble_discovery_inc = [
27  "$dsoftbus_root_path/core/discovery/ble/dispatcher/include",
28  "$dsoftbus_root_path/core/discovery/ble/approach_ble/include",
29  "$dsoftbus_root_path/core/discovery/ble/share_ble/include",
30  "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include",
31  "$dsoftbus_root_path/core/common/include",
32  "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
33]
34
35ble_discovery_deps = [ "$dsoftbus_dfx_path/log:softbus_dfx_log" ]
36
37if (!support_bluetooth) {
38  ble_discovery_src = [ "$dsoftbus_root_path/core/discovery/ble/dispatcher/src/disc_ble_dispatcher_virtual.c" ]
39} else {
40  if (!dsoftbus_feature_disc_ble) {
41    ble_discovery_src = [ "$dsoftbus_root_path/core/discovery/ble/dispatcher/src/disc_ble_dispatcher_virtual.c" ]
42  } else {
43    ble_discovery_src = [
44      "$dsoftbus_root_path/core/discovery/ble/dispatcher/src/disc_ble_dispatcher.c",
45      "$dsoftbus_root_path/core/discovery/ble/softbus_ble/src/disc_ble_utils.c",
46      "$dsoftbus_root_path/core/discovery/ble/softbus_ble/src/disc_ble.c",
47    ]
48  }
49}
50
51if (disc_enhanced) {
52  import(
53      "$dsoftbus_root_path/dsoftbus_enhance/core/discovery/ble/approach_ble/approach_ble.gni")
54  import(
55      "$dsoftbus_root_path/dsoftbus_enhance/core/discovery/ble/share_ble/share_ble.gni")
56
57  ble_discovery_src += share_sources + approach_sources
58  ble_discovery_inc += share_include_dirs + approach_include_dirs
59  ble_discovery_deps += share_deps + approach_deps
60} else {
61  ble_discovery_src += [
62    "$dsoftbus_root_path/core/discovery/ble/share_ble/src/disc_share_ble_virtual.c",
63    "$dsoftbus_root_path/core/discovery/ble/approach_ble/src/disc_approach_ble_virtual.c",
64  ]
65}
66