From 0a9c74aa9ad94c5b26cb8475798824bdfe3dac61 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Tue, 27 Aug 2019 11:38:43 +0200 Subject: [PATCH] Fixed bug 3918 - HIDAPI, CMake support for android project --- CMakeLists.txt | 8 ++++++++ android-project/app/jni/CMakeLists.txt | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce8426d11ba58..d381238b4ccd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -933,6 +933,10 @@ if(ANDROID) list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_LOG_LIBRARY} ${ANDROID_LIBRARY_LIBRARY}) add_definitions(-DGL_GLEXT_PROTOTYPES) + if (HAVE_HIDAPI) + list(APPEND EXTRA_LIBS hidapi) + endif() + #enable gles if(VIDEO_OPENGLES) set(SDL_VIDEO_OPENGL_EGL 1) @@ -1863,6 +1867,10 @@ if (NOT ANDROID) set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) endif() +if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") +endif() + if(SDL_SHARED) add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) if(APPLE) diff --git a/android-project/app/jni/CMakeLists.txt b/android-project/app/jni/CMakeLists.txt index 75a6e7014b7d5..3d49cf3437db3 100644 --- a/android-project/app/jni/CMakeLists.txt +++ b/android-project/app/jni/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.6) project(GAME) -# Settings -set(HIDAPI OFF CACHE BOOL "" FORCE) - # armeabi-v7a requires cpufeatures library # include(AndroidNdkModules) # android_ndk_import_module_cpufeatures()