diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c07be6f57..68d9e5f9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 |