summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 17 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba207dfd1..97afaf1a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,8 @@ option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
option(YUZU_USE_BUNDLED_BOOST "Download bundled Boost" OFF)
+option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF)
+
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" ON "WIN32" OFF)
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
@@ -420,14 +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)
- find_package(LibUSB)
-endif()
-if (NOT LIBUSB_FOUND)
- add_subdirectory(externals/libusb)
- set(LIBUSB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/libusb/libusb/libusb")
- set(LIBUSB_LIBRARIES usb)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24)
+ else()
+ find_package(LibUSB)
+ endif()
+
+ if (LIBUSB_FOUND)
+ add_library(usb INTERFACE)
+ target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
+ target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}")
+ else()
+ message(WARNING "libusb not found, falling back to externals")
+ set(YUZU_USE_BUNDLED_LIBUSB ON)
+ endif()
endif()
# List of all FFmpeg components required