From f272382cd1bcd97589e5bd54bf5bb2769a8bc159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Vanda=C3=ABle?= Date: Fri, 2 Jan 2026 14:40:24 +0100 Subject: SDL: Use bundled LibUSB when desirable Previously, SDL would `find_package(libusb)` which would actually overwrite the user preference in the case where both USE_SYSTEM_LIBUSB and USE_SYSTEM_SDL were OFF. This coincidentally also allows SDL to use libusb on Windows. --- Externals/libusb/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Externals/libusb') diff --git a/Externals/libusb/CMakeLists.txt b/Externals/libusb/CMakeLists.txt index dafb563f72..ffd6d42781 100644 --- a/Externals/libusb/CMakeLists.txt +++ b/Externals/libusb/CMakeLists.txt @@ -125,4 +125,15 @@ check_include_files(sys/timerfd.h HAVE_TIMERFD) check_include_files(unistd.h HAVE_UNISTD_H) configure_file(config.h.in config.h) -add_library(LibUSB::LibUSB ALIAS usb) + +# We don't create an ALIAS here so that dependencies (SDL) that try_compile libusb +# don't fail due to LibUSB::LibUSB being an alias target +add_library(LibUSB::LibUSB INTERFACE IMPORTED GLOBAL) +target_link_libraries(LibUSB::LibUSB + INTERFACE + usb +) +target_include_directories(LibUSB::LibUSB + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/libusb/libusb +) -- cgit v1.2.3