QT_CFLAGS_GSTREAMER=
QT_LIBS_GSTREAMER=
+# default qpa platform
+QT_QPA_DEFAULT_PLATFORM=
+
#-------------------------------------------------------------------------------
# check SQL drivers available in this package
#-------------------------------------------------------------------------------
shift
VAL=$1
;;
- -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir)
+ -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
DeviceVar set $DEV_VAR $DEV_VAL
;;
+ qpa)
+ QT_QPA_DEFAULT_PLATFORM="$VAL"
+ ;;
debug-and-release)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_DEBUG_RELEASE="$VAL"
$DFBN -no-directfb ....... Do not compile DirectFB support.
$DFBY -directfb .......... Compile DirectFB support.
+ -qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).
+
-xplatform target ... The target platform when cross-compiling.
-sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot.
fi
fi
+# Determine the default QPA platform
+if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
+ # check the mkspec
+ QT_QPA_DEFAULT_PLATFORM=`getXQMakeConf QT_QPA_DEFAULT_PLATFORM`
+ if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
+ if [ "$BUILD_ON_MAC" = "yes" ]; then
+ QT_QPA_DEFAULT_PLATFORM="cocoa"
+ elif [ "$UNAME_SYSTEM" = "QNX" ]; then
+ QT_QPA_DEFAULT_PLATFORM="qnx"
+ else
+ QT_QPA_DEFAULT_PLATFORM="xcb"
+ fi
+ fi
+fi
+
if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
EOF
fi
+echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
+
# avoid unecessary rebuilds by copying only if qconfig.h has changed
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
rm -f "$outpath/src/corelib/global/qconfig.h.new"
}
}
- if (name.isEmpty()) {
- const QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
-#if defined(Q_OS_MAC)
- const QString defaultPlatform = QLatin1String("cocoa");
-#elif defined (Q_OS_WIN)
- const QString defaultPlatform = QLatin1String("windows");
-#elif defined (Q_OS_QNX)
- const QString defaultPlatform = QLatin1String("qnx");
-#elif !defined (QT_NO_XCB)
- const QString defaultPlatform = QLatin1String("xcb");
-#elif !defined (QT_NO_WAYLAND)
- const QString defaultPlatform = QLatin1String("wayland");
-#elif !defined (QT_NO_EGLFS)
- const QString defaultPlatform = QLatin1String("eglfs");
-#else
- const QString defaultPlatform = QLatin1String("minimal");
-#endif
- if (keys.contains(defaultPlatform)) {
- qWarning("No platform plugin argument was specified, defaulting to \"%s\".",
- qPrintable(defaultPlatform));
- name = defaultPlatform;
- } else {
- qFatal("No platform plugin argument was specified and the default plugin \"%s\" is not available",
- qPrintable(defaultPlatform));
- }
- }
-
// Create the platform integration.
QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath);
if (QGuiApplicationPrivate::platform_integration) {