cmake: General improvements to libusb linking
Delegates libusb external communication to externals/CMakeLists.txt Ensures an interface library `usb` for every pathway input_common just links to the `usb` library now externals/libusb/CMakeLists.txt sets variables to override SDL2's libusb finding Other minor cleanup
This commit is contained in:
parent
55dd027115
commit
ddc47e6df8
4 changed files with 31 additions and 17 deletions
|
@ -422,18 +422,22 @@ elseif (TARGET Boost::boost)
|
|||
endif()
|
||||
|
||||
# Ensure libusb is properly configured (based on dolphin libusb include)
|
||||
if(NOT APPLE)
|
||||
if(NOT APPLE AND NOT YUZU_USE_BUNDLED_LIBUSB)
|
||||
include(FindPkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24)
|
||||
else()
|
||||
find_package(LibUSB)
|
||||
endif()
|
||||
endif()
|
||||
if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB)
|
||||
add_subdirectory(externals/libusb)
|
||||
set(LIBUSB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/libusb/libusb/libusb")
|
||||
set(LIBUSB_LIBRARIES usb)
|
||||
|
||||
if (NOT LIBUSB_FOUND)
|
||||
message(WARNING "libusb not found, falling back to externals")
|
||||
set(YUZU_USE_BUNDLED_LIBUSB ON)
|
||||
else()
|
||||
add_library(usb INTERFACE)
|
||||
target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
|
||||
target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# List of all FFmpeg components required
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue