cmake: allow hidapi to use libusb on Windows

When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
This commit is contained in:
Anonymous Maarten
2023-11-29 22:08:09 +01:00
committed by Sam Lantinga
parent 3bc27d3856
commit 7341d5f361
3 changed files with 197 additions and 5 deletions

View File

@@ -133,8 +133,7 @@ endif()
# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
# so we'll just use libusb when it's available. libusb does not support iOS,
# so we default to yes on iOS.
# TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR VISIONOS OR ANDROID)
if(IOS OR TVOS OR VISIONOS OR ANDROID)
set(SDL_HIDAPI_LIBUSB_AVAILABLE FALSE)
else()
set(SDL_HIDAPI_LIBUSB_AVAILABLE TRUE)