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")
15
16bus_center_ledger_src = [
17  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c",
18  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c",
19  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_huks_utils.c",
20  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_net_capability.c",
21  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c",
22  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c",
23  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c",
24]
25if (dsoftbus_feature_lnn_net) {
26  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c" ]
27  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger_manager.c" ]
28} else {
29  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger_virtual.c" ]
30}
31if (dsoftbus_feature_lnn_meta_node) {
32  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_meta_node_ledger.c" ]
33} else {
34  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_meta_node_ledger_virtual.c" ]
35}
36bus_center_ledger_inc = [
37  "$dsoftbus_root_path/adapter/common/include",
38  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
39  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
40  "$dsoftbus_root_path/core/adapter/bus_center/include",
41  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
42  "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
43  "$dsoftbus_root_path/core/bus_center/utils/include",
44  "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
45  "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
46  "$dsoftbus_root_path/interfaces/kits/common",
47]
48bus_center_ledger_deps = []
49bus_center_ledger_external_deps = [ "huks:libhukssdk" ]
50
51net_ledger_native_source_path = rebase_path("$dsoftbus_root_path")
52net_ledger_dep_dir = "dsoftbus_enhance/core/bus_center/lnn/lane_hub"
53net_ledger_enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
54                                  [
55                                    "$net_ledger_native_source_path",
56                                    "$net_ledger_dep_dir",
57                                  ],
58                                  "value")
59
60if (defined(ohos_lite)) {
61  bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/src/lnn_decision_db_virtual.c" ]
62  bus_center_ledger_inc +=
63      [ "//base/security/huks/interfaces/inner_api/huks_standard/main/include" ]
64  if (ohos_kernel_type != "liteos_m") {
65    bus_center_ledger_deps +=
66        [ "//base/security/huks/interfaces/inner_api/huks_lite:huks_3.0_sdk" ]
67  }
68} else {
69  if (net_ledger_enhanced) {
70    bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/src/lnn_decision_db.c" ]
71  } else {
72    bus_center_ledger_src += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/src/lnn_decision_db_virtual.c" ]
73  }
74}
75