1# Copyright (c) 2023 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("./../../../hdf_core/adapter/uhdf2/uhdf.gni") 16import("./../usb.gni") 17 18config("ddk_public_config") { 19 include_dirs = [ 20 "include/", 21 "${usb_driver_path}/ddk/ndk/", 22 ] 23} 24 25ohos_shared_library("libusb_ddk_service_1.0") { 26 sanitize = { 27 integer_overflow = true 28 ubsan = true 29 boundary_sanitize = true 30 } 31 32 sources = [ 33 "src/usb_ddk_hash.cpp", 34 "src/usb_ddk_service.cpp", 35 ] 36 include_dirs = [ 37 "${usb_driver_path}/interfaces/ddk/host", 38 "${usb_driver_path}/interfaces/ddk/common", 39 "${usb_driver_path}/ddk/host/include", 40 "${hdf_framework_path}/model/usb/include", 41 ] 42 43 configs = [ ":ddk_public_config" ] 44 45 deps = [ 46 "${usb_driver_path}/ddk:libusb_ddk_host", 47 "${usb_driver_path}/ddk:libusb_pnp_manager", 48 ] 49 50 external_deps = [ 51 "c_utils:utils", 52 "drivers_interface_usb:usb_ddk_idl_headers", 53 "hdf_core:libhdf_host", 54 "hdf_core:libhdf_ipc_adapter", 55 "hdf_core:libhdf_utils", 56 "hdf_core:libhdi", 57 "hilog:libhilog", 58 "hisysevent:libhisysevent", 59 "ipc:ipc_single", 60 ] 61 62 install_images = [ chipset_base_dir ] 63 subsystem_name = "hdf" 64 part_name = "drivers_peripheral_usb" 65} 66 67ohos_shared_library("libusb_ddk_driver") { 68 sanitize = { 69 integer_overflow = true 70 ubsan = true 71 boundary_sanitize = true 72 } 73 74 sources = [ "src/usb_ddk_driver.cpp" ] 75 76 external_deps = [ 77 "c_utils:utils", 78 "drivers_interface_usb:libusb_ddk_stub_1.0", 79 "hdf_core:libhdf_host", 80 "hdf_core:libhdf_ipc_adapter", 81 "hdf_core:libhdf_utils", 82 "hdf_core:libhdi", 83 "hilog:libhilog", 84 "ipc:ipc_single", 85 ] 86 87 configs = [ ":ddk_public_config" ] 88 89 shlib_type = "hdi" 90 install_images = [ chipset_base_dir ] 91 subsystem_name = "hdf" 92 part_name = "drivers_peripheral_usb" 93} 94 95group("usb_ddk_target") { 96 deps = [ 97 ":libusb_ddk_driver", 98 ":libusb_ddk_service_1.0", 99 ] 100} 101