• 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("//foundation/communication/dsoftbus/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      "//foundation/communication/dsoftbus/interfaces/kits/common",
24      "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
25      "//foundation/communication/dsoftbus/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      "//foundation/communication/dsoftbus/interfaces/kits/common",
46      "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
47      "//foundation/communication/dsoftbus/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        "hiviewdfx_hilog_native: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      "//commonlibrary/c_utils/base/include",
80      "//third_party/bounds_checking_function/include",
81      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include",
82      "$dsoftbus_root_path/core/common/include",
83      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
84      "$dsoftbus_root_path/adapter/common/include",
85      "$dsoftbus_root_path/components/nstackx/nstackx_util/interface",
86      "$dsoftbus_root_path/interfaces/kits/transport",
87      "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include",
88      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/include",
89      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/src",
90      "$dsoftbus_root_path/sdk/transmission/ipc/include",
91    ]
92
93    deps = [
94      "$dsoftbus_root_path/core/common:softbus_utils",
95      "$dsoftbus_root_path/core/frame:softbus_server",
96      "$dsoftbus_root_path/sdk:softbus_client",
97      "//third_party/googletest:gtest_main",
98    ]
99
100    native_source_path = rebase_path("$dsoftbus_root_path")
101    dep_file = "components/nstackx_enhanced/nstackx_core/dfile/BUILD.gn"
102    enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
103                       [
104                         "$native_source_path",
105                         "$dep_file",
106                       ],
107                       "value")
108
109    if (enhanced) {
110      deps += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile:nstackx_dfile" ]
111    } else {
112      deps += [ "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile:nstackx_dfile.open" ]
113    }
114
115    if (is_standard_system) {
116      external_deps = [
117        "c_utils:utils",
118        "hiviewdfx_hilog_native:libhilog",
119      ]
120    } else {
121      external_deps = [
122        "c_utils:utils",
123        "hilog:libhilog",
124      ]
125    }
126  }
127
128  group("unittest") {
129    testonly = true
130    deps = [ ":TransSdkFileTest" ]
131  }
132}
133