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
16dsoftbus_file_sdk_path =
17    "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file"
18
19trans_file_sdk_inc = [ "$dsoftbus_file_sdk_path/include" ]
20trans_file_sdk_src = []
21trans_file_sdk_deps = []
22
23if (dsoftbus_feature_trans_udp_file == true) {
24  trans_file_sdk_src += [
25    "$dsoftbus_file_sdk_path/src/client_trans_file.c",
26    "$dsoftbus_file_sdk_path/src/client_trans_file_listener.c",
27    "$dsoftbus_file_sdk_path/src/file_adapter.c",
28  ]
29
30  native_source_path = rebase_path("$dsoftbus_root_path")
31  dep_file = "components/nstackx_enhanced/nstackx_core/dfile/BUILD.gn"
32  enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
33                         [
34                           "$native_source_path",
35                           "$dep_file",
36                         ],
37                         "value")
38  dep_fileschema =
39      "dsoftbus_enhance/sdk/transmission/trans_channel/udp/file/BUILD.gn"
40  enhanced_share = exec_script("$dsoftbus_root_path/check_sub_module.py",
41                               [
42                                 "$native_source_path",
43                                 "$dep_fileschema",
44                               ],
45                               "value")
46  if (enhanced) {
47    trans_file_sdk_inc += [
48      "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile/interface",
49      "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_util/interface",
50    ]
51    trans_file_sdk_deps += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile:nstackx_dfile" ]
52    if (enhanced_share) {
53      trans_file_sdk_inc += [
54        "$dsoftbus_root_path/dsoftbus_enhance/interfaces/kits/transport",
55        "$dsoftbus_root_path/dsoftbus_enhance/sdk/transmission/trans_channel/udp/file/include",
56      ]
57      trans_file_sdk_deps += [ "$dsoftbus_root_path/dsoftbus_enhance/sdk/transmission/trans_channel/udp/file:dsoftbus_file_schema_service" ]
58    } else {
59      trans_file_sdk_src +=
60          [ "$dsoftbus_file_sdk_path/src/client_trans_file_schema_virtual.c" ]
61    }
62  } else {
63    trans_file_sdk_inc += [
64      "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile/interface",
65      "$dsoftbus_root_path/components/nstackx/nstackx_util/interface",
66    ]
67    trans_file_sdk_deps += [ "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile:nstackx_dfile.open" ]
68    trans_file_sdk_src +=
69        [ "$dsoftbus_file_sdk_path/src/client_trans_file_schema_virtual.c" ]
70  }
71} else {
72  trans_file_sdk_src +=
73      [ "$dsoftbus_file_sdk_path/src/client_trans_file_virtual.c" ]
74}
75