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