# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright 2026 DruidApps. Library-only compliance build helper.
cmake_minimum_required(VERSION 3.31)
project(druid_libusb_source_offer LANGUAGES C)
if(NOT DEFINED LIBUSB_SOURCE_ROOT)
  message(FATAL_ERROR "Set LIBUSB_SOURCE_ROOT to the verified upstream source directory")
endif()
set(usb "${LIBUSB_SOURCE_ROOT}")
add_library(usb-1.0 SHARED ${usb}/libusb/core.c ${usb}/libusb/descriptor.c ${usb}/libusb/hotplug.c
  ${usb}/libusb/io.c ${usb}/libusb/sync.c ${usb}/libusb/strerror.c ${usb}/libusb/os/linux_usbfs.c
  ${usb}/libusb/os/events_posix.c ${usb}/libusb/os/threads_posix.c ${usb}/libusb/os/linux_netlink.c)
target_include_directories(usb-1.0 PUBLIC ${usb}/libusb PRIVATE ${usb}/android ${usb}/libusb/os)
target_compile_options(usb-1.0 PRIVATE -O2 -fvisibility=hidden)
target_link_libraries(usb-1.0 PRIVATE log)
