Skip to content

Commit 741f37c

Browse files
committed
Workaround against undefined SDL_PollEvents reference for windows build
1 parent 7145f10 commit 741f37c

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

projects/unix/buildwin32.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ UNAME=MINGW32
55
DESTDIR=./dist_win32
66

77
HID_CFLAGS="-I $HIDHOME/hidapi"
8-
HID_LDLIBS="-L $HIDHOME/windows/.libs/ -lhidapi"
8+
HID_LDLIBS="-L $HIDHOME/windows/.libs/ -lhidapi sdl.lib"
99
TARGETS=all
1010
MAKEFILE=Makefile
1111

@@ -14,6 +14,10 @@ if [ $? -ne 0 ]; then
1414
exit 1
1515
fi
1616

17+
# Hack to let this project link without requiring libsdl. Without
18+
# this linking will fail due to a missing symbol (SDL_PumpEvents)
19+
i686-w64-mingw32-dlltool -d sdl.def -l sdl.lib
20+
1721
make -f $MAKEFILE CROSS_COMPILE=i686-w64-mingw32- UNAME=$UNAME HID_CFLAGS="$HID_CFLAGS" HID_LDLIBS="$HID_LDLIBS" $TARGETS V=1
1822
if [ $? -ne 0 ]; then
1923
exit 1

projects/unix/buildwin64.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ UNAME=MINGW64
55
DESTDIR=./dist_win64
66

77
HID_CFLAGS="-I $HIDHOME/hidapi"
8-
HID_LDLIBS="-L $HIDHOME/windows/.libs/ -lhidapi"
8+
HID_LDLIBS="-L $HIDHOME/windows/.libs/ -lhidapi sdl.lib"
99
TARGETS=all
1010
MAKEFILE=Makefile
1111

@@ -14,6 +14,10 @@ if [ $? -ne 0 ]; then
1414
exit 1
1515
fi
1616

17+
# Hack to let this project link without requiring libsdl. Without
18+
# this linking will fail due to a missing symbol (SDL_PumpEvents)
19+
x86_64-w64-mingw32-dlltool -d sdl.def -l sdl.lib
20+
1721
make -f $MAKEFILE CROSS_COMPILE=x86_64-w64-mingw32- UNAME=$UNAME HID_CFLAGS="$HID_CFLAGS" HID_LDLIBS="$HID_LDLIBS" $TARGETS V=1
1822
if [ $? -ne 0 ]; then
1923
exit 1

projects/unix/sdl.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LIBRARY SDL.dll
2+
EXPORTS
3+
SDL_PumpEvents

0 commit comments

Comments
 (0)