Fixed bug 3774 - Cmake build fails for Android
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Aug 2017 21:17:12 -0700
changeset 11353598839965877
parent 11352 bd65950cd775
child 11354 323fc605104f
Fixed bug 3774 - Cmake build fails for Android

sfalexrog

Android haptic code was not added to CMakeLists.txt, leading to build failures when targeting Android platform.

Attached patch adds Android haptic driver to source sets and adds configuration parameter to SDL_config.h.cmake.
CMakeLists.txt
include/SDL_config.h.cmake
     1.1 --- a/CMakeLists.txt	Sat Aug 26 21:20:20 2017 +0200
     1.2 +++ b/CMakeLists.txt	Sat Aug 26 21:17:12 2017 -0700
     1.3 @@ -801,6 +801,12 @@
     1.4      set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_FILESYSTEM_SOURCES})
     1.5      set(HAVE_SDL_FILESYSTEM TRUE)
     1.6    endif()
     1.7 +  if(SDL_HAPTIC)
     1.8 +    set(SDL_HAPTIC_ANDROID 1)
     1.9 +    file(GLOB ANDROID_HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/android/*.c)
    1.10 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_HAPTIC_SOURCES})
    1.11 +    set(HAVE_SDL_HAPTIC TRUE)
    1.12 +  endif()
    1.13    if(SDL_JOYSTICK)
    1.14      set(SDL_JOYSTICK_ANDROID 1)
    1.15      file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c)
     2.1 --- a/include/SDL_config.h.cmake	Sat Aug 26 21:20:20 2017 +0200
     2.2 +++ b/include/SDL_config.h.cmake	Sat Aug 26 21:17:12 2017 -0700
     2.3 @@ -265,6 +265,7 @@
     2.4  #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
     2.5  #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
     2.6  #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
     2.7 +#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
     2.8  
     2.9  /* Enable various shared object loading systems */
    2.10  #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@