• 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
14if (defined(ohos_lite)) {
15  import("//build/ohos.gni")
16
17  ohos_executable("usbhost_ddk_test") {
18    include_dirs = [
19      "//third_party/bounds_checking_function/include",
20      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
21      "//drivers/peripheral/usb/sample/host/include",
22      "//drivers/peripheral/usb/ddk/common/include",
23      "//drivers/peripheral/usb/ddk/device/include",
24      "//drivers/peripheral/usb/ddk/host/include",
25      "//drivers/peripheral/usb/interfaces/ddk/common",
26      "//drivers/peripheral/usb/interfaces/ddk/host",
27      "//drivers/peripheral/usb/gadget/function/include",
28    ]
29
30    sources = [
31      "src/usbhost_ddk_test.c",
32      "src/usbhost_test.c",
33    ]
34
35    deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
36    external_deps = [ "device_driver_framework:libhdf_utils" ]
37    defines = [ "__LITEOS_USB_HOST_DDK_TEST__" ]
38
39    install_enable = false
40    subsystem_name = "hdf"
41    part_name = "usb_device_driver"
42  }
43} else {
44  import("//build/ohos.gni")
45  import("//drivers/adapter/uhdf2/uhdf.gni")
46
47  ohos_executable("usbhost_ddk_test") {
48    include_dirs = [
49      "//utils/native/base/include",
50      "include",
51      "//drivers/peripheral/usb/ddk/common/include",
52      "//drivers/peripheral/usb/ddk/device/include",
53      "//drivers/peripheral/usb/ddk/host/include",
54      "//drivers/peripheral/usb/interfaces/ddk/common",
55      "//drivers/peripheral/usb/interfaces/ddk/host",
56      "//drivers/peripheral/usb/gadget/function/include",
57      "//drivers/peripheral/usb/serial/include",
58    ]
59
60    sources = [
61      "src/usbhost_ddk_test.c",
62      "src/usbhost_test.c",
63    ]
64
65    if (is_standard_system) {
66      external_deps = [
67        "device_driver_framework:libhdf_host",
68        "device_driver_framework:libhdf_ipc_adapter",
69        "device_driver_framework:libhdf_utils",
70        "device_driver_framework:libhdi",
71        "hiviewdfx_hilog_native:libhilog",
72        "utils_base:utils",
73      ]
74    } else {
75      external_deps = [ "hilog:libhilog" ]
76    }
77
78    install_enable = false
79    install_images = [ chipset_base_dir ]
80    subsystem_name = "hdf"
81    part_name = "usb_device_driver"
82  }
83
84  group("usb_pnp_sample_driver") {
85    deps = [ ":libusb_pnp_sample_driver" ]
86  }
87
88  ohos_shared_library("libusb_pnp_sample_driver") {
89    sources = [ "src/usb_pnp_sample.c" ]
90
91    include_dirs = [
92      "//drivers/peripheral/usb/ddk/common/include",
93      "//drivers/peripheral/usb/ddk/host/include",
94      "//drivers/peripheral/usb/interfaces/ddk/common",
95      "//drivers/peripheral/usb/interfaces/ddk/host",
96      "include",
97      "//drivers/peripheral/usb/serial/include",
98    ]
99
100    deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ]
101
102    if (is_standard_system) {
103      external_deps = [
104        "device_driver_framework:libhdf_host",
105        "device_driver_framework:libhdf_ipc_adapter",
106        "device_driver_framework:libhdf_utils",
107        "hiviewdfx_hilog_native:libhilog",
108        "utils_base:utils",
109      ]
110    } else {
111      external_deps = [ "hilog:libhilog" ]
112    }
113
114    install_images = [ chipset_base_dir ]
115    subsystem_name = "hdf"
116    part_name = "usb_device_driver"
117  }
118
119  ohos_executable("usbhost_pnp_test") {
120    include_dirs = [
121      "//utils/native/base/include",
122      "include",
123      "//drivers/peripheral/usb/serial/include",
124    ]
125
126    sources = [ "src/usbhost_pnp_test.c" ]
127
128    if (is_standard_system) {
129      external_deps = [
130        "device_driver_framework:libhdf_host",
131        "device_driver_framework:libhdf_ipc_adapter",
132        "device_driver_framework:libhdf_utils",
133        "device_driver_framework:libhdi",
134        "hiviewdfx_hilog_native:libhilog",
135        "utils_base:utils",
136      ]
137    } else {
138      external_deps = [ "hilog:libhilog" ]
139    }
140
141    install_enable = false
142    install_images = [ chipset_base_dir ]
143    subsystem_name = "hdf"
144    part_name = "usb_device_driver"
145  }
146
147  ohos_executable("usbhost_sdkapi_speed_test") {
148    sources = [ "src/usbhost_sdkapi_speed.c" ]
149
150    include_dirs = [
151      "//drivers/peripheral/usb/ddk/common/include",
152      "//drivers/peripheral/usb/ddk/host/include",
153      "//drivers/peripheral/usb/interfaces/ddk/common",
154      "//drivers/peripheral/usb/interfaces/ddk/host",
155      "//drivers/peripheral/usb/gadget/function/include",
156      "include",
157      "//drivers/peripheral/usb/serial/include",
158    ]
159
160    deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ]
161
162    if (is_standard_system) {
163      external_deps = [
164        "device_driver_framework:libhdf_host",
165        "device_driver_framework:libhdf_ipc_adapter",
166        "device_driver_framework:libhdf_utils",
167        "hiviewdfx_hilog_native:libhilog",
168        "utils_base:utils",
169      ]
170    } else {
171      external_deps = [ "hilog:libhilog" ]
172    }
173
174    install_enable = false
175    install_images = [ chipset_base_dir ]
176    subsystem_name = "hdf"
177    part_name = "usb_device_driver"
178  }
179
180  ohos_executable("usbhost_sdkraw_speed_test") {
181    sources = [ "src/usbhost_sdkraw_speed.c" ]
182
183    include_dirs = [
184      "//drivers/peripheral/usb/ddk/common/include",
185      "//drivers/peripheral/usb/ddk/host/include",
186      "//drivers/peripheral/usb/gadget/function/include",
187      "//drivers/peripheral/usb/interfaces/ddk/common",
188      "//drivers/peripheral/usb/interfaces/ddk/host",
189      "include",
190      "//drivers/peripheral/usb/serial/include",
191    ]
192
193    deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ]
194
195    if (is_standard_system) {
196      external_deps = [
197        "device_driver_framework:libhdf_host",
198        "device_driver_framework:libhdf_ipc_adapter",
199        "device_driver_framework:libhdf_utils",
200        "hiviewdfx_hilog_native:libhilog",
201        "utils_base:utils",
202      ]
203    } else {
204      external_deps = [ "hilog:libhilog" ]
205    }
206
207    install_enable = false
208    install_images = [ chipset_base_dir ]
209    subsystem_name = "hdf"
210    part_name = "usb_device_driver"
211  }
212
213  ohos_executable("usbhost_nosdk_speed_test") {
214    include_dirs = [
215      "//utils/native/base/include",
216      "include",
217      "//drivers/peripheral/usb/ddk/common/include",
218      "//drivers/peripheral/usb/ddk/device/include",
219      "//drivers/peripheral/usb/ddk/host/include",
220      "//drivers/peripheral/usb/interfaces/ddk/common",
221      "//drivers/peripheral/usb/interfaces/ddk/host",
222      "//drivers/peripheral/usb/gadget/function/include",
223      "//drivers/peripheral/usb/serial/include",
224    ]
225
226    sources = [ "src/usbhost_nosdk_speed.c" ]
227
228    if (is_standard_system) {
229      external_deps = [
230        "device_driver_framework:libhdf_host",
231        "device_driver_framework:libhdf_ipc_adapter",
232        "device_driver_framework:libhdf_utils",
233        "device_driver_framework:libhdi",
234        "hiviewdfx_hilog_native:libhilog",
235        "utils_base:utils",
236      ]
237    } else {
238      external_deps = [ "hilog:libhilog" ]
239    }
240    install_enable = false
241    install_images = [ chipset_base_dir ]
242    subsystem_name = "hdf"
243    part_name = "usb_device_driver"
244  }
245}
246