[Commits] SDL: Fixed bug 3774 - Cmake build fails for Android

libsdl.org revision control commits-owner at libsdl.org
Sat Aug 26 21:17:16 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/598839965877
changeset: 11353:598839965877
user:      Sam Lantinga <slouken at libsdl.org>
date:      Sat Aug 26 21:17:12 2017 -0700
description:
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.

diffstat:

 CMakeLists.txt             |  6 ++++++
 include/SDL_config.h.cmake |  1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r bd65950cd775 -r 598839965877 CMakeLists.txt
--- a/CMakeLists.txt	Sat Aug 26 21:20:20 2017 +0200
+++ b/CMakeLists.txt	Sat Aug 26 21:17:12 2017 -0700
@@ -801,6 +801,12 @@
     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_FILESYSTEM_SOURCES})
     set(HAVE_SDL_FILESYSTEM TRUE)
   endif()
+  if(SDL_HAPTIC)
+    set(SDL_HAPTIC_ANDROID 1)
+    file(GLOB ANDROID_HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/android/*.c)
+    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_HAPTIC_SOURCES})
+    set(HAVE_SDL_HAPTIC TRUE)
+  endif()
   if(SDL_JOYSTICK)
     set(SDL_JOYSTICK_ANDROID 1)
     file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c)
diff -r bd65950cd775 -r 598839965877 include/SDL_config.h.cmake
--- a/include/SDL_config.h.cmake	Sat Aug 26 21:20:20 2017 +0200
+++ b/include/SDL_config.h.cmake	Sat Aug 26 21:17:12 2017 -0700
@@ -265,6 +265,7 @@
 #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
 #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
 #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
+#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
 
 /* Enable various shared object loading systems */
 #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@


More information about the commits mailing list