From 27dfa550ed3bb642c47c00c127959f894d116e1a Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Sat, 20 Aug 2016 15:55:18 -0700 Subject: [PATCH] SDL2: Update project files and update joystick open function for SDL2 --- QGCExternalLibs.pri | 2 +- QGCSetup.pri | 6 +++--- src/Joystick/JoystickSDL.cc | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index 9a06576a9..20f67e28c 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -173,7 +173,7 @@ MacBuild { LIBS += \ -F$$BASEDIR/libs/lib/Frameworks \ - -framework SDL + -framework SDL2 } else:LinuxBuild { PKGCONFIG = sdl2 } else:WindowsBuild { diff --git a/QGCSetup.pri b/QGCSetup.pri index 6a112f52a..1a91836f2 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -49,8 +49,8 @@ iOSBuild | MacBuild { MacBuild { # Copy non-standard frameworks into app package QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/ - # SDL Framework - QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET} + # SDL2 Framework + QMAKE_POST_LINK += && install_name_tool -change "@rpath/SDL2.framework/Versions/A/SDL2" "@executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2" $$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET} } WindowsBuild { @@ -62,7 +62,7 @@ WindowsBuild { DebugBuild: DLL_QT_DEBUGCHAR = "d" ReleaseBuild: DLL_QT_DEBUGCHAR = "" COPY_FILE_LIST = \ - $$BASEDIR\\libs\\lib\\sdl\\win32\\SDL.dll \ + $$BASEDIR\\libs\\lib\\sdl2\\win32\\SDL2.dll \ $$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \ $$BASEDIR\\deploy\\libeay32.dll diff --git a/src/Joystick/JoystickSDL.cc b/src/Joystick/JoystickSDL.cc index 258482636..ea481d206 100644 --- a/src/Joystick/JoystickSDL.cc +++ b/src/Joystick/JoystickSDL.cc @@ -23,7 +23,16 @@ QMap JoystickSDL::discover(MultiVehicleManager* _multiVehicl qCDebug(JoystickLog) << "Available joysticks"; for (int i=0; i