diff options
| author | 2020-07-08 16:30:26 -0400 | |
|---|---|---|
| committer | 2020-07-08 16:30:26 -0400 | |
| commit | 5311b562aa3c619dca9a1a14d0a2b16281a45cc1 (patch) | |
| tree | 7c675aaa3bf59455494c4a430df9fed7ff7c44d4 | |
| parent | Merge pull request #4255 from lioncash/copy (diff) | |
| parent | cmake: unbreak system libusb support (diff) | |
| download | yuzu-5311b562aa3c619dca9a1a14d0a2b16281a45cc1.tar.gz yuzu-5311b562aa3c619dca9a1a14d0a2b16281a45cc1.tar.xz yuzu-5311b562aa3c619dca9a1a14d0a2b16281a45cc1.zip | |
Merge pull request #4266 from jbeich/freebsd
gcadapter: unbreak build on FreeBSD
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | externals/find-modules/FindLibUSB.cmake | 43 | ||||
| -rw-r--r-- | src/input_common/gcadapter/gc_adapter.h | 1 |
3 files changed, 48 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 27383bce8..cd40e5cfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -331,8 +331,10 @@ endif() | |||
| 331 | 331 | ||
| 332 | # Ensure libusb is properly configured (based on dolphin libusb include) | 332 | # Ensure libusb is properly configured (based on dolphin libusb include) |
| 333 | find_package(LibUSB) | 333 | find_package(LibUSB) |
| 334 | add_subdirectory(externals/libusb) | 334 | if (NOT LIBUSB_FOUND) |
| 335 | set(LIBUSB_LIBRARIES usb) | 335 | add_subdirectory(externals/libusb) |
| 336 | set(LIBUSB_LIBRARIES usb) | ||
| 337 | endif() | ||
| 336 | 338 | ||
| 337 | 339 | ||
| 338 | # Prefer the -pthread flag on Linux. | 340 | # Prefer the -pthread flag on Linux. |
diff --git a/externals/find-modules/FindLibUSB.cmake b/externals/find-modules/FindLibUSB.cmake new file mode 100644 index 000000000..dec0b98b0 --- /dev/null +++ b/externals/find-modules/FindLibUSB.cmake | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | # - Find libusb-1.0 library | ||
| 2 | # This module defines | ||
| 3 | # LIBUSB_INCLUDE_DIR, where to find bluetooth.h | ||
| 4 | # LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0. | ||
| 5 | # LIBUSB_FOUND, If false, do not try to use libusb-1.0. | ||
| 6 | # | ||
| 7 | # Copyright (c) 2009, Michal Cihar, <michal@cihar.com> | ||
| 8 | # | ||
| 9 | # vim: expandtab sw=4 ts=4 sts=4: | ||
| 10 | |||
| 11 | if(ANDROID) | ||
| 12 | set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found") | ||
| 13 | message(STATUS "libusb-1.0 not found.") | ||
| 14 | elseif (NOT LIBUSB_FOUND) | ||
| 15 | pkg_check_modules (LIBUSB_PKG libusb-1.0) | ||
| 16 | |||
| 17 | find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h | ||
| 18 | PATHS | ||
| 19 | ${LIBUSB_PKG_INCLUDE_DIRS} | ||
| 20 | /usr/include/libusb-1.0 | ||
| 21 | /usr/include | ||
| 22 | /usr/local/include/libusb-1.0 | ||
| 23 | /usr/local/include | ||
| 24 | ) | ||
| 25 | |||
| 26 | find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb | ||
| 27 | PATHS | ||
| 28 | ${LIBUSB_PKG_LIBRARY_DIRS} | ||
| 29 | /usr/lib | ||
| 30 | /usr/local/lib | ||
| 31 | ) | ||
| 32 | |||
| 33 | if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) | ||
| 34 | set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found") | ||
| 35 | message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}") | ||
| 36 | else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) | ||
| 37 | set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found") | ||
| 38 | message(STATUS "libusb-1.0 not found.") | ||
| 39 | endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) | ||
| 40 | |||
| 41 | mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) | ||
| 42 | endif () | ||
| 43 | |||
diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h index 0ea6263eb..b1c2a1958 100644 --- a/src/input_common/gcadapter/gc_adapter.h +++ b/src/input_common/gcadapter/gc_adapter.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <mutex> | 8 | #include <mutex> |
| 9 | #include <thread> | 9 | #include <thread> |
| 10 | #include <unordered_map> | ||
| 10 | #include <libusb.h> | 11 | #include <libusb.h> |
| 11 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 12 | #include "common/threadsafe_queue.h" | 13 | #include "common/threadsafe_queue.h" |