diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-10-26 14:26:16 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-10-31 10:54:34 +0000 |
commit | 56b101c01c8b7b0b75951afaeaa82e0ab8e59dcd (patch) | |
tree | 41679ef3b8f86f99c0d44d255a0328f9cc94571a | |
parent | 095d854f186634a01bf1127fc41f07e7078abe0b (diff) |
Convert the module to the new configuration system
... and clean up the SDL detection. This also enables SDL use on
non-macOS Darwin platforms, per the library's documentation.
Change-Id: I4111fc8cb75b30662fe93b90e76a0c5563140656
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | config.tests/sdl/sdl.pro | 12 | ||||
-rw-r--r-- | configure.json | 5 | ||||
-rw-r--r-- | qtgamepad.pro | 4 | ||||
-rw-r--r-- | src/gamepad/configure.json | 41 | ||||
-rw-r--r-- | src/plugins/gamepads/gamepads.pro | 4 | ||||
-rw-r--r-- | src/plugins/gamepads/sdl2/sdl2.pro | 12 |
6 files changed, 49 insertions, 29 deletions
diff --git a/config.tests/sdl/sdl.pro b/config.tests/sdl/sdl.pro index 7d5263a..7b447d1 100644 --- a/config.tests/sdl/sdl.pro +++ b/config.tests/sdl/sdl.pro @@ -1,15 +1,3 @@ SOURCES += main.cpp QT = CONFIG -= qt - -osx:{ - INCLUDEPATH += /Library/Frameworks/SDL2.framework/Headers - LIBS += -F/Library/Frameworks/ -framework SDL2 -} - -unix:!osx{ - CONFIG += link_pkgconfig - PKGCONFIG += sdl2 -} - -win32: LIBS += -lSDL2 -lSDL2main diff --git a/configure.json b/configure.json new file mode 100644 index 0000000..c5953c1 --- /dev/null +++ b/configure.json @@ -0,0 +1,5 @@ +{ + "subconfigs": [ + "src/gamepad" + ] +} diff --git a/qtgamepad.pro b/qtgamepad.pro index 99a88ff..58c33f2 100644 --- a/qtgamepad.pro +++ b/qtgamepad.pro @@ -1,5 +1 @@ -load(configure) - -qtCompileTest(sdl) - load(qt_parts) diff --git a/src/gamepad/configure.json b/src/gamepad/configure.json new file mode 100644 index 0000000..fef25d3 --- /dev/null +++ b/src/gamepad/configure.json @@ -0,0 +1,41 @@ +{ + "module": "gamepad", + "testDir": "../../config.tests", + + "libraries": { + "sdl2": { + "label": "SDL2", + "test": "sdl", + "sources": [ + { "type": "pkgConfig", "args": "sdl2" }, + { + "libs": "-F/Library/Frameworks/ -framework SDL2", + "includedir": "/Library/Frameworks/SDL2.framework/Headers", + "condition": "config.darwin" + }, + { "libs": "-lSDL2 -lSDL2main", "condition": "config.win32" }, + { "libs": "-lSDL2", "condition": "config.unix && !config.darwin" } + ] + } + }, + + "features": { + "sdl2": { + "label": "SDL2", + "condition": "libs.sdl2", + "output": [ "privateFeature" ] + } + }, + + "report": [ + ], + + "summary": [ + { + "section": "Qt Gamepad", + "entries": [ + "sdl2" + ] + } + ] +} diff --git a/src/plugins/gamepads/gamepads.pro b/src/plugins/gamepads/gamepads.pro index b372359..dd60750 100644 --- a/src/plugins/gamepads/gamepads.pro +++ b/src/plugins/gamepads/gamepads.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -QT_FOR_CONFIG += gui-private -config_sdl:SUBDIRS += sdl2 +QT_FOR_CONFIG += gui-private gamepad-private +qtConfig(sdl2): SUBDIRS += sdl2 !android: qtConfig(evdev): SUBDIRS += evdev win32: !wince*: SUBDIRS += xinput darwin: !watchos: SUBDIRS += darwin diff --git a/src/plugins/gamepads/sdl2/sdl2.pro b/src/plugins/gamepads/sdl2/sdl2.pro index 3d53711..91715a3 100644 --- a/src/plugins/gamepads/sdl2/sdl2.pro +++ b/src/plugins/gamepads/sdl2/sdl2.pro @@ -5,17 +5,7 @@ PLUGIN_TYPE = gamepads PLUGIN_CLASS_NAME = QSdl2GamepadBackendPlugin load(qt_plugin) -osx { - INCLUDEPATH += /Library/Frameworks/SDL2.framework/Headers - LIBS += -F/Library/Frameworks/ -framework SDL2 -} - -unix:!osx{ - CONFIG += link_pkgconfig - PKGCONFIG += sdl2 -} - -win32: LIBS += -lSDL2 +QMAKE_USE += sdl2 HEADERS += qsdlgamepadbackend_p.h SOURCES += \ |