• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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/config/components/hdi/hdi.gni")
15import("//build/ohos.gni")
16import("./../usb.gni")
17
18ohos_shared_library("libusb_adapter") {
19  sanitize = {
20    integer_overflow = true
21    ubsan = true
22    boundary_sanitize = true
23    cfi = true
24    cfi_cross_dso = true
25    debug = false
26  }
27
28  include_dirs = [
29    "./include",
30    "${usb_driver_path}/utils/include",
31  ]
32
33  sources = [ "src/libusb_adapter.cpp" ]
34  version_script = "libusb_adapter.map"
35
36  shlib_type = "hdi"
37
38  if (is_standard_system) {
39    external_deps = [
40      "access_token:libaccesstoken_sdk",
41      "drivers_interface_usb:libusb_stub_1.2",
42      "hdf_core:libhdf_host",
43      "hdf_core:libhdf_utils",
44      "hdf_core:libhdi",
45      "hilog:libhilog",
46      "hitrace:hitrace_meter",
47      "ipc:ipc_single",
48      "libusb:libusb",
49    ]
50    if (usb_c_utils_enable) {
51      external_deps += [ "c_utils:utils" ]
52    }
53  } else {
54    external_deps = [
55      "drivers_interface_usb:libusb_stub_1.2",
56      "hilog:libhilog",
57    ]
58  }
59
60  install_images = [ chipset_base_dir ]
61  innerapi_tags = [ "passthrough_indirect" ]
62  subsystem_name = "hdf"
63  part_name = "drivers_peripheral_usb"
64}
65