Fixed bug 3918 - HIDAPI, CMake support for android project
authorSylvain Becker <sylvain.becker@gmail.com>
Tue, 27 Aug 2019 11:38:43 +0200
changeset 13039bfed06214c2a
parent 13038 b5f5c317e652
child 13040 58a4430a9492
Fixed bug 3918 - HIDAPI, CMake support for android project
CMakeLists.txt
android-project/app/jni/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Mon Aug 26 17:43:01 2019 -0700
     1.2 +++ b/CMakeLists.txt	Tue Aug 27 11:38:43 2019 +0200
     1.3 @@ -933,6 +933,10 @@
     1.4      list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_LOG_LIBRARY} ${ANDROID_LIBRARY_LIBRARY})
     1.5      add_definitions(-DGL_GLEXT_PROTOTYPES)
     1.6  
     1.7 +    if (HAVE_HIDAPI)
     1.8 +        list(APPEND EXTRA_LIBS hidapi)
     1.9 +    endif()
    1.10 +
    1.11      #enable gles
    1.12      if(VIDEO_OPENGLES)
    1.13        set(SDL_VIDEO_OPENGL_EGL 1)
    1.14 @@ -1863,6 +1867,10 @@
    1.15    set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
    1.16  endif()
    1.17  
    1.18 +if (ANDROID AND HAVE_HIDAPI)
    1.19 +  set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi")
    1.20 +endif()
    1.21 +
    1.22  if(SDL_SHARED)
    1.23    add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
    1.24    if(APPLE)
     2.1 --- a/android-project/app/jni/CMakeLists.txt	Mon Aug 26 17:43:01 2019 -0700
     2.2 +++ b/android-project/app/jni/CMakeLists.txt	Tue Aug 27 11:38:43 2019 +0200
     2.3 @@ -2,9 +2,6 @@
     2.4  
     2.5  project(GAME)
     2.6  
     2.7 -# Settings
     2.8 -set(HIDAPI OFF CACHE BOOL "" FORCE)
     2.9 -
    2.10  # armeabi-v7a requires cpufeatures library
    2.11  # include(AndroidNdkModules)
    2.12  # android_ndk_import_module_cpufeatures()