Fixed bug 4911 - Build broken when hidapi enabled

meyraud705

SDL_hidapi.c is added twice to 'SOURCES' which causes "multiple definition error" when linking.
This commit is contained in:
Sam Lantinga 2019-12-22 13:42:20 -08:00
parent 5e19e66c73
commit dd5987e80a
2 changed files with 1 additions and 6 deletions

4
configure vendored
View File

@ -24332,6 +24332,7 @@ $as_echo "#define SDL_JOYSTICK_HIDAPI 1" >>confdefs.h
EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi" EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c" SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
if test x$have_libusb_h = xyes; then if test x$have_libusb_h = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS" EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
@ -24343,7 +24344,6 @@ $as_echo "#define SDL_JOYSTICK_HIDAPI 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5
$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&2;} $as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&2;}
fi fi
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
# libusb is loaded dynamically, so don't add it to LDFLAGS # libusb is loaded dynamically, so don't add it to LDFLAGS
libusb_lib="" libusb_lib=""
case "$host" in case "$host" in
@ -24363,8 +24363,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
fi fi
else
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
fi fi
fi fi

View File

@ -3326,7 +3326,6 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
if test x$have_loadso != xyes; then if test x$have_loadso != xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libusb loading]) AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libusb loading])
fi fi
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
# libusb is loaded dynamically, so don't add it to LDFLAGS # libusb is loaded dynamically, so don't add it to LDFLAGS
libusb_lib="" libusb_lib=""
case "$host" in case "$host" in
@ -3342,8 +3341,6 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
fi fi
AC_DEFINE_UNQUOTED(SDL_LIBUSB_DYNAMIC, "$libusb_lib", [ ]) AC_DEFINE_UNQUOTED(SDL_LIBUSB_DYNAMIC, "$libusb_lib", [ ])
fi fi
else
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
fi fi
fi fi