• 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("//build/test.gni")
15import("../../../../../../dsoftbus.gni")
16
17module_output_path = "dsoftbus/transmission"
18
19if (defined(ohos_lite)) {
20  executable("dsoftbus_app_dfile") {
21    sources = [ "dsoftbus_app_dfile.c" ]
22    include_dirs = [
23      "../../../../../../interfaces/kits/common",
24      "../../../../../../interfaces/kits/bus_center",
25      "../../../../../../interfaces/kits/common",
26      "$dsoftbus_root_path/interfaces/kits/transport",
27      "$dsoftbus_root_path//core/common/include",
28      "//third_party/bounds_checking_function/include",
29    ]
30    deps = [
31      "$dsoftbus_root_path/core/common:softbus_utils",
32      "$dsoftbus_root_path/sdk:softbus_client",
33      "//third_party/bounds_checking_function:libsec_shared",
34    ]
35  }
36} else {
37  import("//build/ohos.gni")
38
39  ###########################palTest###########################
40  ohos_executable("dsoftbus_app_dfile") {
41    install_enable = true
42    sources = [ "dsoftbus_app_dfile.cpp" ]
43
44    include_dirs = [
45      "../../../../../../interfaces/kits/common",
46      "../../../../../../interfaces/kits/bus_center",
47      "../../../../../../interfaces/kits/common",
48      "$dsoftbus_root_path/interfaces/kits/transport",
49    ]
50
51    deps = [
52      "$dsoftbus_root_path/core/common:softbus_utils",
53      "$dsoftbus_root_path/sdk:softbus_client",
54    ]
55
56    if (is_standard_system) {
57      external_deps = [
58        "c_utils:utils",
59        "hilog:libhilog",
60      ]
61      part_name = "dsoftbus"
62    }
63    subsystem_name = "communication"
64  }
65
66  ohos_unittest("TransSdkFileTest") {
67    module_out_path = module_output_path
68    sources = [ "trans_sdk_file_test.cpp" ]
69
70    include_dirs = [
71      "$dsoftbus_root_path/interfaces/kits/transport",
72      "dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/include",
73      "dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/src",
74      "$dsoftbus_root_path/sdk/transmission/session/cpp/include",
75      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
76      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/src",
77      "$dsoftbus_root_path/sdk/transmission/session/include",
78      "$dsoftbus_root_path/adapter/common/include",
79      "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile/core",
80      "//commonlibrary/c_utils/base/include",
81      "//third_party/bounds_checking_function/include",
82      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include",
83      "$dsoftbus_root_path/core/common/include",
84      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
85      "$dsoftbus_root_path/adapter/common/include",
86      "$dsoftbus_root_path/components/nstackx/nstackx_util/interface",
87      "$dsoftbus_root_path/interfaces/kits/transport",
88      "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include",
89      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/include",
90      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/src",
91      "$dsoftbus_root_path/sdk/transmission/ipc/include",
92
93      "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile/core",
94    ]
95
96    deps = [
97      "$dsoftbus_root_path/core/common:softbus_utils",
98      "$dsoftbus_root_path/core/frame:softbus_server",
99      "$dsoftbus_root_path/sdk:softbus_client",
100      "//third_party/googletest:gtest_main",
101    ]
102
103    native_source_path = rebase_path("$dsoftbus_root_path")
104    dep_file = "components/nstackx_enhanced/nstackx_core/dfile/BUILD.gn"
105    enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
106                           [
107                             "$native_source_path",
108                             "$dep_file",
109                           ],
110                           "value")
111
112    if (enhanced) {
113      deps += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile:nstackx_dfile" ]
114    } else {
115      deps += [ "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile:nstackx_dfile.open" ]
116    }
117
118    if (is_standard_system) {
119      external_deps = [
120        "c_utils:utils",
121        "hilog:libhilog",
122      ]
123    } else {
124      external_deps = [
125        "c_utils:utils",
126        "hilog:libhilog",
127      ]
128    }
129  }
130
131  group("unittest") {
132    testonly = true
133    deps = [ ":TransSdkFileTest" ]
134  }
135}
136