@@ -165,25 +165,47 @@ endif
165
165
# Dependencies
166
166
dl_dep = cc.find_library (' dl' , required : false )
167
167
gl_dep = dependency (' gl' , required : false )
168
- egl_dep = dependency (' egl' , required : false )
169
- elg_headers_dep = egl_dep.partial_dependency(compile_args : true , includes : true )
170
168
171
169
# Optional dependencies for tests
172
170
x11_dep = dependency (' x11' , required : false )
173
171
x11_headers_dep = x11_dep.partial_dependency(compile_args : true , includes : true )
174
172
175
- # GLES v2 and v1 may have pkg-config files, courtesy of downstream
176
- # packagers; let's check those first, and fall back to find_library()
177
- # if we fail
173
+ # We have multiple checks for EGL and GLES v2/v1 to support different providers:
174
+ # 1. pkg-config for Mesa
175
+ # 2. find_library() for ANGLE, which do not support pkg-config nor CMake.
176
+ # Note that Microsoft's "link" requires "lib" prefix.
177
+ # 3. CMake for Qt 5, which bundles ANGLE.
178
+ egl_dep = dependency (' egl' , required : false )
179
+ if not egl_dep.found()
180
+ egl_dep = cc.find_library (' EGL' , required : false )
181
+ endif
182
+ if not egl_dep.found()
183
+ egl_dep = cc.find_library (' libEGL.dll' , required : false )
184
+ endif
185
+ if not egl_dep.found()
186
+ egl_dep = dependency (' Qt5Gui' , modules : ' Qt5::Gui_EGL' , required : false )
187
+ endif
188
+
178
189
gles2_dep = dependency (' glesv2' , required : false )
179
190
if not gles2_dep.found()
180
- gles2_dep = cc.find_library (' libGLESv2' , required : false )
191
+ gles2_dep = cc.find_library (' GLESv2' , required : false )
192
+ endif
193
+ if not gles2_dep.found()
194
+ gles2_dep = cc.find_library (' libGLESv2.dll' , required : false )
195
+ endif
196
+ if not gles2_dep.found()
197
+ egl_dep = dependency (' Qt5Gui' , modules : ' Qt5::Gui_GLESv2' , required : false )
181
198
endif
182
199
183
200
gles1_dep = dependency (' glesv1_cm' , required : false )
184
201
if not gles1_dep.found()
185
- gles1_dep = cc.find_library (' libGLESv1_CM ' , required : false )
202
+ gles1_dep = cc.find_library (' GLESv1_CM ' , required : false )
186
203
endif
204
+ if not gles1_dep.found()
205
+ gles1_dep = cc.find_library (' libGLESv1_CM.dll' , required : false )
206
+ endif
207
+
208
+ elg_headers_dep = egl_dep.partial_dependency(compile_args : true , includes : true )
187
209
188
210
# On windows, the DLL has to have all of its functions
189
211
# resolved at link time, so we have to link directly against
0 commit comments