qml: Don't build OpenGL support if OpenGL is not available in Qt.
authorRobin Burchell <robin.burchell@viroteck.net>
Tue, 28 Jul 2015 12:41:46 +0000 (12:41 +0000)
committerRobin Burchell <robin.burchell@viroteck.net>
Mon, 17 Aug 2015 11:21:37 +0000 (11:21 +0000)
Change-Id: I66c841778eb0ae662c3951a26665c83e233851b5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
tools/qml/main.cpp

index 206788c..c2718de 100644 (file)
@@ -209,7 +209,7 @@ public Q_SLOTS:
         //Will be checked before calling exec()
         earlyExit = true;
     }
-#ifdef QT_GUI_LIB
+#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
     void onOpenGlContextCreated(QOpenGLContext *context);
 #endif
 };
@@ -231,7 +231,7 @@ 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*)));
@@ -241,7 +241,7 @@ void LoadWatcher::checkForWindow(QObject *o)
 #endif // QT_GUI_LIB
 }
 
-#ifdef QT_GUI_LIB
+#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
 void LoadWatcher::onOpenGlContextCreated(QOpenGLContext *context)
 {
     context->makeCurrent(qobject_cast<QWindow *>(sender()));