Merge pull request #12767 from guijan/libusb-pc

use pkg-config to find libusb
This commit is contained in:
Admiral H. Curtiss 2024-05-21 22:36:45 +02:00 committed by GitHub
commit 2ba6093b30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -703,7 +703,9 @@ include_directories(Externals/soundtouch)
dolphin_find_optional_system_library(CUBEB Externals/cubeb)
if(NOT ANDROID)
dolphin_find_optional_system_library(LibUSB Externals/libusb)
dolphin_find_optional_system_library_pkgconfig(
LibUSB libusb-1.0 LibUSB::LibUSB Externals/libusb
)
add_definitions(-D__LIBUSB__)
endif()

View File

@ -15,7 +15,7 @@ else()
target_link_libraries(hidapi PRIVATE udev)
else()
target_sources(hidapi PRIVATE hidapi-src/libusb/hid.c)
target_link_libraries(hidapi PRIVATE ${LIBUSB_LIBRARIES})
target_link_libraries(hidapi PRIVATE LibUSB::LibUSB)
endif()
endif()