From 1a1f1704a2b70146621f0253395f17d0a8643527 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 27 May 2020 10:35:43 -0700 Subject: [PATCH] Don't include the iOS joystick driver if joysticks are disabled --- configure.ac | 3 +++ src/joystick/SDL_joystick.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 36e7086c9..474ed03d1 100644 --- a/configure.ac +++ b/configure.ac @@ -3902,6 +3902,9 @@ AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m" SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" have_joystick=yes + else + # Need this code for accelerometer as joystick support + SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m" fi # Set up files for the haptic library #if test x$enable_haptic = xyes; then diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index e2bce51cf..e9aa5e192 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -70,7 +70,7 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = { #ifdef SDL_JOYSTICK_IOKIT &SDL_DARWIN_JoystickDriver, #endif -#if defined(__IPHONEOS__) || defined(__TVOS__) +#if (defined(__IPHONEOS__) || defined(__TVOS__)) && !defined(SDL_JOYSTICK_DISABLED) &SDL_IOS_JoystickDriver, #endif #ifdef SDL_JOYSTICK_ANDROID