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 ] 22} 23 24ohos_shared_library("libusb_ddk_host") { 25 include_dirs = [ 26 "$hdf_framework_path/include/config", 27 "$hdf_framework_path/ability/config/hcs_parser/include", 28 "$hdf_framework_path/include/utils", 29 "$hdf_framework_path/utils/include", 30 "$hdf_framework_path/include/core", 31 "$hdf_uhdf_path/include/host", 32 "device/include", 33 "host/include", 34 "//drivers/peripheral/usb/interfaces/ddk/common", 35 "//drivers/peripheral/usb/interfaces/ddk/device", 36 "//drivers/peripheral/usb/interfaces/ddk/host", 37 ] 38 sources = [ 39 "host/src/linux_adapter.c", 40 "host/src/usb_interface_pool.c", 41 "host/src/usb_io_manage.c", 42 "host/src/usb_protocol.c", 43 "host/src/usb_raw_api.c", 44 "host/src/usb_raw_api_library.c", 45 ] 46 47 deps = [ 48 "$hdf_uhdf_path/config:uhdf_hcs_pkg", 49 "$hdf_uhdf_path/osal:libhdf_utils", 50 "//utils/native/base:utils", 51 ] 52 53 if (is_standard_system) { 54 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 55 } else { 56 external_deps = [ "hilog:libhilog" ] 57 } 58 59 subsystem_name = "hdf" 60} 61 62ohos_shared_library("libusb_ddk_device") { 63 include_dirs = [ 64 "$hdf_framework_path/include/config", 65 "$hdf_framework_path/ability/config/hcs_parser/include", 66 "$hdf_framework_path/include/utils", 67 "$hdf_framework_path/utils/include", 68 "$hdf_framework_path/include/core", 69 "$hdf_uhdf_path/include/host", 70 "device/include", 71 "host/include", 72 "//drivers/peripheral/usb/interfaces/ddk/common", 73 "//drivers/peripheral/usb/interfaces/ddk/device", 74 "//drivers/peripheral/usb/interfaces/ddk/host", 75 ] 76 sources = [ 77 "device/src/adapter_if.c", 78 "device/src/usbfn_cfg_mgr.c", 79 "device/src/usbfn_dev_mgr.c", 80 "device/src/usbfn_io_mgr.c", 81 "device/src/usbfn_sdk_if.c", 82 ] 83 84 deps = [ 85 "$hdf_uhdf_path/config:uhdf_hcs_pkg", 86 "$hdf_uhdf_path/osal:libhdf_utils", 87 "//utils/native/base:utils", 88 ] 89 90 if (is_standard_system) { 91 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 92 } else { 93 external_deps = [ "hilog:libhilog" ] 94 } 95 96 subsystem_name = "hdf" 97} 98