diff options
| author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-06-03 03:49:35 -0400 |
|---|---|---|
| committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-06-03 03:49:35 -0400 |
| commit | ddc47e6df8cd9e06d799933f67e75ba6f8952acd (patch) | |
| tree | f1fd486d62f031cc4606c42dab2fea60d3af5fd2 /CMakeLists.txt | |
| parent | 55dd027115e72ca2ffc6a0bbf8f131d380c73faa (diff) | |
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
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 |
