• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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/hdf_core/adapter/uhdf2/uhdf.gni")
16import("//drivers/peripheral/usb/usb.gni")
17
18config("usbd_private_config") {
19  include_dirs = []
20}
21
22config("usbd_public_config") {
23  include_dirs = [
24    "${usb_driver_path}/hdi_service/include",
25    "${usb_driver_path}/ddk/host/include",
26    "${usb_driver_path}/interfaces/ddk/host",
27    "${usb_driver_path}/interfaces/ddk/common",
28    "${usb_driver_path}/gadget/function/include",
29    "//drivers/hdf_core/framework/model/usb/include",
30    "${usb_driver_path}/hdi_service",
31    "${usb_driver_path}/interfaces/ddk/common/include",
32    "${usb_driver_path}/interfaces/ddk/device",
33    "${default_config_path}",
34  ]
35}
36
37ohos_shared_library("libusb_interface_service_1.0") {
38  sources = [
39    "src/usb_impl.cpp",
40    "src/usbd_dispatcher.cpp",
41    "src/usbd_function.cpp",
42    "src/usbd_load_usb_service.cpp",
43    "src/usbd_port.cpp",
44  ]
45
46  configs = [ ":usbd_private_config" ]
47
48  public_configs = [ ":usbd_public_config" ]
49
50  deps = [
51    "${usb_driver_path}/ddk:libusb_ddk_host",
52    "${usb_driver_path}/ddk:libusb_pnp_manager",
53  ]
54
55  if (is_standard_system) {
56    external_deps = [
57      "c_utils:utils",
58      "drivers_interface_usb:usb_idl_headers",
59      "hdf_core:libhdf_utils",
60      "hdf_core:libhdi",
61      "hiviewdfx_hilog_native:libhilog",
62      "init:libbegetutil",
63      "ipc:ipc_single",
64      "samgr:samgr_proxy",
65    ]
66  } else {
67    external_deps = [
68      "hilog:libhilog",
69      "ipc:ipc_single",
70    ]
71  }
72
73  install_images = [ chipset_base_dir ]
74  subsystem_name = "hdf"
75  part_name = "drivers_peripheral_usb"
76}
77
78ohos_shared_library("libusb_driver") {
79  sources = [ "src/usb_interface_driver.cpp" ]
80
81  public_deps = [
82    ":libusb_interface_service_1.0",
83    "//drivers/interface/usb/v1_0:libusb_stub_1.0",
84  ]
85
86  configs = [ ":usbd_private_config" ]
87
88  public_configs = [ ":usbd_public_config" ]
89
90  if (is_standard_system) {
91    external_deps = [
92      "c_utils:utils",
93      "hdf_core:libhdf_ipc_adapter",
94      "hdf_core:libhdi",
95      "hiviewdfx_hilog_native:libhilog",
96      "ipc:ipc_single",
97    ]
98  } else {
99    external_deps = [
100      "hilog:libhilog",
101      "ipc:ipc_single",
102    ]
103  }
104
105  install_images = [ chipset_base_dir ]
106  subsystem_name = "hdf"
107  part_name = "drivers_peripheral_usb"
108}
109
110group("hdi_usb_service") {
111  deps = [
112    ":libusb_driver",
113    ":libusb_interface_service_1.0",
114  ]
115}
116