• 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/lite/config/component/lite_component.gni")
15
16HDF_FRAMEWORKS = "//drivers/framework"
17
18lite_component("usbfn_sample") {
19  features = [
20    ":acm_test",
21    ":acm_read",
22    ":acm_write",
23    ":acm_speed_write",
24    ":acm_speed_read",
25    ":prop_test",
26  ]
27}
28
29executable("acm_test") {
30  sources = [ "acm_test.c" ]
31
32  include_dirs = [
33    "$HDF_FRAMEWORKS/ability/sbuf/include",
34    "$HDF_FRAMEWORKS/core/shared/include",
35    "$HDF_FRAMEWORKS/core/host/include",
36    "$HDF_FRAMEWORKS/core/master/include",
37    "$HDF_FRAMEWORKS/include/core",
38    "$HDF_FRAMEWORKS/include/utils",
39    "$HDF_FRAMEWORKS/utils/include",
40    "$HDF_FRAMEWORKS/include/osal",
41    "//drivers/adapter/uhdf/posix/include",
42    "//third_party/bounds_checking_function/include",
43    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
44  ]
45
46  deps = [
47    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
48    "//drivers/adapter/uhdf/manager:hdf_core",
49    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
50  ]
51
52  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
53  defines = [ "__USER__" ]
54
55  cflags = [
56    "-Wall",
57    "-Wextra",
58    "-Wno-format",
59    "-Wno-format-extra-args",
60  ]
61
62  ldflags = [
63    "-L$ohos_root_path/sysroot/usr/lib",
64    "-Wl,-rpath-link=$ohos_root_path/sysroot/usr/lib",
65    "-lstdc++",
66    "-lpthread",
67  ]
68}
69
70executable("acm_read") {
71  sources = [ "acm_read.c" ]
72
73  include_dirs = [
74    "$HDF_FRAMEWORKS/ability/sbuf/include",
75    "$HDF_FRAMEWORKS/core/shared/include",
76    "$HDF_FRAMEWORKS/core/host/include",
77    "$HDF_FRAMEWORKS/core/master/include",
78    "$HDF_FRAMEWORKS/include/core",
79    "$HDF_FRAMEWORKS/include/utils",
80    "$HDF_FRAMEWORKS/utils/include",
81    "$HDF_FRAMEWORKS/include/osal",
82    "//drivers/adapter/uhdf/posix/include",
83    "//third_party/bounds_checking_function/include",
84    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
85  ]
86
87  deps = [
88    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
89    "//drivers/adapter/uhdf/manager:hdf_core",
90    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
91  ]
92
93  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
94  defines = [ "__USER__" ]
95
96  cflags = [
97    "-Wall",
98    "-Wextra",
99    "-Wno-format",
100    "-Wno-format-extra-args",
101  ]
102}
103
104executable("acm_write") {
105  sources = [ "acm_write.c" ]
106
107  include_dirs = [
108    "$HDF_FRAMEWORKS/ability/sbuf/include",
109    "$HDF_FRAMEWORKS/core/shared/include",
110    "$HDF_FRAMEWORKS/core/host/include",
111    "$HDF_FRAMEWORKS/core/master/include",
112    "$HDF_FRAMEWORKS/include/core",
113    "$HDF_FRAMEWORKS/include/utils",
114    "$HDF_FRAMEWORKS/utils/include",
115    "$HDF_FRAMEWORKS/include/osal",
116    "//drivers/adapter/uhdf/posix/include",
117    "//third_party/bounds_checking_function/include",
118    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
119  ]
120
121  deps = [
122    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
123    "//drivers/adapter/uhdf/manager:hdf_core",
124    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
125  ]
126
127  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
128  defines = [ "__USER__" ]
129
130  cflags = [
131    "-Wall",
132    "-Wextra",
133    "-Wno-format",
134    "-Wno-format-extra-args",
135  ]
136}
137
138executable("acm_speed_write") {
139  sources = [ "acm_speed_write.c" ]
140
141  include_dirs = [
142    "$HDF_FRAMEWORKS/ability/sbuf/include",
143    "$HDF_FRAMEWORKS/core/shared/include",
144    "$HDF_FRAMEWORKS/core/host/include",
145    "$HDF_FRAMEWORKS/core/master/include",
146    "$HDF_FRAMEWORKS/include/core",
147    "$HDF_FRAMEWORKS/include/utils",
148    "$HDF_FRAMEWORKS/utils/include",
149    "$HDF_FRAMEWORKS/include/osal",
150    "//drivers/adapter/uhdf/posix/include",
151    "//third_party/bounds_checking_function/include",
152    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
153  ]
154
155  deps = [
156    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
157    "//drivers/adapter/uhdf/manager:hdf_core",
158    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
159  ]
160
161  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
162  defines = [ "__USER__" ]
163
164  cflags = [
165    "-Wall",
166    "-Wextra",
167    "-Wno-format",
168    "-Wno-format-extra-args",
169  ]
170
171  ldflags = [
172    "-L$ohos_root_path/sysroot/usr/lib",
173    "-Wl,-rpath-link=$ohos_root_path/sysroot/usr/lib",
174    "-lstdc++",
175    "-lpthread",
176  ]
177}
178
179executable("acm_speed_read") {
180  sources = [ "acm_speed_read.c" ]
181
182  include_dirs = [
183    "$HDF_FRAMEWORKS/ability/sbuf/include",
184    "$HDF_FRAMEWORKS/core/shared/include",
185    "$HDF_FRAMEWORKS/core/host/include",
186    "$HDF_FRAMEWORKS/core/master/include",
187    "$HDF_FRAMEWORKS/include/core",
188    "$HDF_FRAMEWORKS/include/utils",
189    "$HDF_FRAMEWORKS/utils/include",
190    "$HDF_FRAMEWORKS/include/osal",
191    "//drivers/adapter/uhdf/posix/include",
192    "//third_party/bounds_checking_function/include",
193    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
194  ]
195
196  deps = [
197    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
198    "//drivers/adapter/uhdf/manager:hdf_core",
199    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
200  ]
201
202  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
203  defines = [ "__USER__" ]
204
205  cflags = [
206    "-Wall",
207    "-Wextra",
208    "-Wno-format",
209    "-Wno-format-extra-args",
210  ]
211
212  ldflags = [
213    "-L$ohos_root_path/sysroot/usr/lib",
214    "-Wl,-rpath-link=$ohos_root_path/sysroot/usr/lib",
215    "-lstdc++",
216    "-lpthread",
217  ]
218}
219
220executable("prop_test") {
221  sources = [ "prop_test.c" ]
222
223  include_dirs = [
224    "$HDF_FRAMEWORKS/ability/sbuf/include",
225    "$HDF_FRAMEWORKS/core/shared/include",
226    "$HDF_FRAMEWORKS/core/host/include",
227    "$HDF_FRAMEWORKS/core/master/include",
228    "$HDF_FRAMEWORKS/include/core",
229    "$HDF_FRAMEWORKS/include/utils",
230    "$HDF_FRAMEWORKS/utils/include",
231    "$HDF_FRAMEWORKS/include/osal",
232    "//drivers/adapter/uhdf/posix/include",
233    "//third_party/bounds_checking_function/include",
234    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
235  ]
236
237  deps = [
238    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
239    "//drivers/adapter/uhdf/manager:hdf_core",
240    "//drivers/adapter/uhdf/posix:hdf_posix_osal",
241  ]
242
243  public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
244  defines = [ "__USER__" ]
245
246  cflags = [
247    "-Wall",
248    "-Wextra",
249    "-Wno-format",
250    "-Wno-format-extra-args",
251  ]
252}
253