1# Copyright (c) 2022-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 18ohos_shared_library("libusbfn_mtp_interface_service_1.0") { 19 sanitize = { 20 integer_overflow = true 21 ubsan = true 22 boundary_sanitize = true 23 } 24 25 sources = [ "src/usbfn_mtp_impl.cpp" ] 26 27 include_dirs = [ 28 "./../../../interfaces/ddk/device", 29 "./../../../interfaces/ddk/common", 30 "${usb_driver_path}/gadget/function/include", 31 "${usb_driver_path}/gadget/function/mtp/include", 32 ] 33 34 deps = [ "${usb_driver_path}/ddk:libusb_ddk_device" ] 35 36 external_deps = [ 37 "c_utils:utils", 38 "drivers_interface_usb:usbfn_mtp_idl_headers", 39 "hdf_core:libhdf_host", 40 "hdf_core:libhdf_utils", 41 "hilog:libhilog", 42 "ipc:ipc_single", 43 ] 44 45 install_images = [ chipset_base_dir ] 46 subsystem_name = "hdf" 47 part_name = "drivers_peripheral_usb" 48} 49 50ohos_shared_library("libusbfn_mtp_driver") { 51 sanitize = { 52 integer_overflow = true 53 ubsan = true 54 boundary_sanitize = true 55 } 56 57 sources = [ "src/usbfn_mtp_interface_driver.cpp" ] 58 59 include_dirs = [ 60 "./../../../interfaces/ddk/device", 61 "./../../../interfaces/ddk/common", 62 "${usb_driver_path}/gadget/function/include", 63 "${usb_driver_path}/gadget/function/mtp/include", 64 ] 65 66 deps = [] 67 68 external_deps = [ 69 "c_utils:utils", 70 "drivers_interface_usb:libusbfn_mtp_stub_1.0", 71 "hdf_core:libhdf_host", 72 "hdf_core:libhdf_ipc_adapter", 73 "hdf_core:libhdf_utils", 74 "hdf_core:libhdi", 75 "hilog:libhilog", 76 "ipc:ipc_single", 77 ] 78 79 shlib_type = "hdi" 80 install_images = [ chipset_base_dir ] 81 subsystem_name = "hdf" 82 part_name = "drivers_peripheral_usb" 83} 84 85group("hdi_usbfn_mtp_service") { 86 deps = [ 87 ":libusbfn_mtp_driver", 88 ":libusbfn_mtp_interface_service_1.0", 89 ] 90} 91