diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp
index 2fd91f30d06a6664c3d9d5acb84b0e815573775d..f057542ca67ce48e521f1f57bc4f6b3d83cd4550 100644
--- a/src/compositor/wayland_wrapper/qwlcompositor.cpp
+++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp
@@ -89,9 +89,11 @@
 
 #include <wayland-server.h>
 
+#if defined (QT_COMPOSITOR_WAYLAND_GL)
 #include "hardware_integration/qwlhwintegration_p.h"
 #include "hardware_integration/qwlclientbufferintegration_p.h"
 #include "hardware_integration/qwlserverbufferintegration_p.h"
+#endif
 #include "windowmanagerprotocol/waylandwindowmanagerintegration_p.h"
 
 #include "hardware_integration/qwlclientbufferintegrationfactory_p.h"
@@ -470,6 +472,7 @@ void Compositor::bindGlobal(wl_client *client, void *data, uint32_t version, uin
 
 void Compositor::loadClientBufferIntegration()
 {
+#ifdef QT_COMPOSITOR_WAYLAND_GL
     QStringList keys = ClientBufferIntegrationFactory::keys();
     QString targetKey;
     QByteArray clientBufferIntegration = qgetenv("QT_WAYLAND_HARDWARE_INTEGRATION");
@@ -491,11 +494,13 @@ void Compositor::loadClientBufferIntegration()
                 m_hw_integration->setClientBufferIntegration(targetKey);
         }
     }
-    //BUG: if there is no client buffer integration, bad things will when opengl is used
+    //BUG: if there is no client buffer integration, bad things will happen when opengl is used
+#endif
 }
 
 void Compositor::loadServerBufferIntegration()
 {
+#ifdef QT_COMPOSITOR_WAYLAND_GL
     QStringList keys = ServerBufferIntegrationFactory::keys();
     QString targetKey;
     QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION");
@@ -507,6 +512,7 @@ void Compositor::loadServerBufferIntegration()
         if (m_hw_integration)
             m_hw_integration->setServerBufferIntegration(targetKey);
     }
+#endif
 }
 
 void Compositor::registerInputDevice(QWaylandInputDevice *device)
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
index 8e07068bc142ee55cf73b9cc923df4d50cd17ccf..580e71d0bc222ae275512c420650b0a76a9caad0 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
@@ -95,7 +95,12 @@ public:
     bool isDestroyed() { return m_destroyed; }
 
     void createTexture();
+#ifdef QT_COMPOSITOR_WAYLAND_GL
     inline GLuint texture() const;
+#else
+    inline uint texture() const;
+#endif
+
     void destroyTexture();
 
     inline struct ::wl_resource *waylandBufferHandle() const { return m_buffer; }
@@ -150,12 +155,19 @@ private:
     friend class ::QWaylandBufferRef;
 };
 
+#ifdef QT_COMPOSITOR_WAYLAND_GL
 GLuint SurfaceBuffer::texture() const
 {
     if (m_buffer)
         return m_texture;
     return 0;
 }
+#else
+uint SurfaceBuffer::texture() const
+{
+    return 0;
+}
+#endif
 
 }