qml: Don't build OpenGL support if OpenGL is not available in Qt.
authorKai Koehne <kai.koehne@theqtcompany.com>
Tue, 18 Aug 2015 13:54:41 +0000 (15:54 +0200)
committerKai Koehne <kai.koehne@theqtcompany.com>
Wed, 19 Aug 2015 13:48:28 +0000 (13:48 +0000)
This is an amended backport of change 668ccf18d in dev.

Change-Id: I168a4d5a55c34592599a557bef941ce1629c8178
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
tools/qml/main.cpp

index 0553553..06ed37a 100644 (file)
@@ -196,7 +196,7 @@ public Q_SLOTS:
             exit(2);//Different return code from qFatal
         }
     }
-#ifdef QT_GUI_LIB
+#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
     void onOpenGlContextCreated(QOpenGLContext *context);
 #endif
 };
@@ -218,17 +218,17 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath)
 
 void LoadWatcher::checkForWindow(QObject *o)
 {
-#ifdef QT_GUI_LIB
+#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
     if (verboseMode && o->isWindowType() && o->inherits("QQuickWindow")) {
         connect(o, SIGNAL(openglContextCreated(QOpenGLContext*)),
                 this, SLOT(onOpenGlContextCreated(QOpenGLContext*)));
     }
 #else
     Q_UNUSED(o)
-#endif // QT_GUI_LIB
+#endif // QT_GUI_LIB && !QT_NO_OPENGL
 }
 
-#ifdef QT_GUI_LIB
+#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
 void LoadWatcher::onOpenGlContextCreated(QOpenGLContext *context)
 {
     context->makeCurrent(qobject_cast<QWindow *>(sender()));
@@ -244,7 +244,7 @@ void LoadWatcher::onOpenGlContextCreated(QOpenGLContext *context)
     puts(output.constData());
     context->doneCurrent();
 }
-#endif // QT_GUI_LIB
+#endif // QT_GUI_LIB && !QT_NO_OPENGL
 
 void quietMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const QString &msg)
 {