diff --git a/tests/auto/cmake/test_opengl_lib/main.cpp b/tests/auto/cmake/test_opengl_lib/main.cpp index 1e874ed4fc..db3e8a261b 100644 --- a/tests/auto/cmake/test_opengl_lib/main.cpp +++ b/tests/auto/cmake/test_opengl_lib/main.cpp @@ -40,24 +40,31 @@ ****************************************************************************/ -#if GL_IMPLEMENTATION_GLES2 -#include -#elif GL_IMPLEMENTATION_GL - #include -#ifdef Q_OS_WIN -#include -#endif - -#ifdef Q_OS_MAC -#include +#ifndef QT_OPENGL_DYNAMIC +# if defined(GL_IMPLEMENTATION_GLES2) +# include +# elif defined(GL_IMPLEMENTATION_GL) +# ifdef Q_OS_WIN +# include +# endif +# ifdef Q_OS_MAC +# include +# else +# include +# endif +# endif #else -#include -#endif +# include #endif int main(int argc, char **argv) { +#ifndef QT_OPENGL_DYNAMIC glGetError(); +#else + QOpenGLFunctions functions; + functions.glGetError(); +#endif return 0; }