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.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index faabcaa..ad86399 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -801,6 +801,12 @@ if(ANDROID)
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 --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 18fa5a4..8f6d844 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -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@