• 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/ohos.gni")
15import("//drivers/adapter/uhdf2/uhdf.gni")
16
17group("libusb_core") {
18  deps = [
19    ":libusb_ddk_device",
20    ":libusb_ddk_host",
21    ":libusb_pnp_manager",
22  ]
23}
24
25ohos_shared_library("libusb_ddk_host") {
26  include_dirs = [
27    "device/include",
28    "host/include",
29    "//drivers/peripheral/usb/interfaces/ddk/common",
30    "//drivers/peripheral/usb/interfaces/ddk/device",
31    "//drivers/peripheral/usb/interfaces/ddk/host",
32  ]
33  sources = [
34    "host/src/linux_adapter.c",
35    "host/src/usb_interface_pool.c",
36    "host/src/usb_io_manage.c",
37    "host/src/usb_protocol.c",
38    "host/src/usb_raw_api.c",
39    "host/src/usb_raw_api_library.c",
40  ]
41
42  if (is_standard_system) {
43    external_deps = [
44      "device_driver_framework:libhdf_host",
45      "device_driver_framework:libhdf_utils",
46      "hiviewdfx_hilog_native:libhilog",
47      "utils_base:utils",
48    ]
49  } else {
50    external_deps = [ "hilog:libhilog" ]
51  }
52
53  install_images = [ chipset_base_dir ]
54  subsystem_name = "hdf"
55  part_name = "usb_device_driver"
56}
57
58ohos_shared_library("libusb_pnp_manager") {
59  include_dirs = [ "$hdf_framework_path/model/usb/include" ]
60  sources = [
61    "$hdf_framework_path/model/usb/src/usb_ddk_pnp_loader.c",
62    "host/src/usb_pnp_manager.c",
63  ]
64
65  if (is_standard_system) {
66    external_deps = [
67      "device_driver_framework:libhdf_host",
68      "device_driver_framework:libhdf_utils",
69      "hiviewdfx_hilog_native:libhilog",
70      "utils_base:utils",
71    ]
72  } else {
73    external_deps = [ "hilog:libhilog" ]
74  }
75
76  install_images = [ chipset_base_dir ]
77  subsystem_name = "hdf"
78  part_name = "usb_device_driver"
79}
80
81ohos_shared_library("libusb_ddk_device") {
82  include_dirs = [
83    "device/include",
84    "host/include",
85    "//drivers/peripheral/usb/interfaces/ddk/common",
86    "//drivers/peripheral/usb/interfaces/ddk/device",
87    "//drivers/peripheral/usb/interfaces/ddk/host",
88  ]
89  sources = [
90    "device/src/adapter_if.c",
91    "device/src/usbfn_cfg_mgr.c",
92    "device/src/usbfn_dev_mgr.c",
93    "device/src/usbfn_io_mgr.c",
94    "device/src/usbfn_sdk_if.c",
95  ]
96
97  if (is_standard_system) {
98    external_deps = [
99      "device_driver_framework:libhdf_host",
100      "device_driver_framework:libhdf_utils",
101      "hiviewdfx_hilog_native:libhilog",
102      "utils_base:utils",
103    ]
104  } else {
105    external_deps = [ "hilog:libhilog" ]
106  }
107
108  install_images = [ chipset_base_dir ]
109  subsystem_name = "hdf"
110  part_name = "usb_device_driver"
111}
112