aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindHIDAPI.cmake
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-07-27 16:57:06 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-07-27 16:57:06 -0400
commite91e2c4a2b617f793bd5109968b105fc96a7f50d (patch)
tree68083a0d5a42373d84d86154a31568c5ab8d4dbe /cmake/FindHIDAPI.cmake
parentMerge pull request #7745 (diff)
parentInclude Libusb and hidapi on android (diff)
downloadmonero-e91e2c4a2b617f793bd5109968b105fc96a7f50d.tar.xz
Merge pull request #7758
42b74a3 Include Libusb and hidapi on android (malinero)
Diffstat (limited to 'cmake/FindHIDAPI.cmake')
-rw-r--r--cmake/FindHIDAPI.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmake/FindHIDAPI.cmake b/cmake/FindHIDAPI.cmake
index 9b45dcc4c..f56bab482 100644
--- a/cmake/FindHIDAPI.cmake
+++ b/cmake/FindHIDAPI.cmake
@@ -39,19 +39,28 @@ find_package_handle_standard_args(HIDAPI
if(HIDAPI_FOUND)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
- if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
+ if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux") OR ANDROID)
find_library(LIBUSB-1.0_LIBRARY usb-1.0)
find_library(LIBUDEV_LIBRARY udev)
if(LIBUSB-1.0_LIBRARY)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUSB-1.0_LIBRARY}")
if(LIBUDEV_LIBRARY)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUDEV_LIBRARY}")
- else()
+ elseif(NOT ANDROID)
message(WARNING "libudev library not found, binaries may fail to link.")
endif()
else()
message(WARNING "libusb-1.0 library not found, binaries may fail to link.")
endif()
+ if(ANDROID)
+ # libusb uses android log library
+ find_library(ANDROID_LOG_LIBRARY log)
+ if(ANDROID_LOG_LIBRARY)
+ set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${ANDROID_LOG_LIBRARY}")
+ else()
+ message(WARNING "Android log library not found, binaries may fail to link.")
+ endif()
+ endif()
endif()
set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")