Fix FindWrapOpenGL to choose the correct GL implementation

The find_package() call for WrapOpenGL was moved to the beginning of
the src/gui project file. This was incorrect, because the features
were not yet computed at that time, and the find module was incorrectly
always choosing the Desktop GL implementation.

Move the find_package() after the add_qt_module() call.

Amends 4f736db08c.

Task-number: QTBUG-74133
Change-Id: Ice1da8f23275843c7285ec748e6d673edbffffac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Alexandru Croitor 2019-04-03 15:15:33 +02:00
parent 9afc605eb5
commit f0cc730197

View File

@ -1,8 +1,6 @@
# special case: # special case:
set(OpenGL_GL_PREFERENCE GLVND) set(OpenGL_GL_PREFERENCE GLVND)
find_package(WrapOpenGL) # special case
##################################################################### #####################################################################
## Gui Module: ## Gui Module:
##################################################################### #####################################################################
@ -441,6 +439,14 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop
kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h
) )
# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf
# acted like WrapOpenGL: direct linkage against either libGLESv2 or
# libGL, depending on the opengl _feature_. This is done by hand now
# here (where the feature is available).
# DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not
# available until the add_qt_module call.
find_package(WrapOpenGL) # special case
extend_target(Gui CONDITION QT_FEATURE_opengl extend_target(Gui CONDITION QT_FEATURE_opengl
SOURCES SOURCES
kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h