meson: fix check whether both gles2 and opengl headers can be included

cc.compiles() doesn't support the prefix: kwarg currently, so it
never had any effect.

https://github.com/mesonbuild/meson/issues/2364
https://bugzilla.gnome.org/show_bug.cgi?id=787964
This commit is contained in:
Tim-Philipp Müller 2018-01-16 11:25:29 +00:00
parent f1324f9cb0
commit df0831ce57

View file

@ -366,7 +366,9 @@ endif
# can we include both gles2 and opengl headers?
if gles2_dep.found() and gl_dep.found()
gl_include_block = gl_include_header + gles_includes + opengl_includes
if not cc.compiles('void f (void) {}', prefix : gl_include_block, dependencies : [gles2_dep, gl_dep] )
# TODO: Revert to passing gl_include_block via prefix: once
# https://github.com/mesonbuild/meson/issues/2364 is fixed
if not cc.compiles(gl_include_block + '\n' + 'void f (void) {}',dependencies : [gles2_dep, gl_dep])
message ('Cannot include both OpenGL and OpenGL ES headers')
if need_gles2 != 'yes'
gles2_dep = unneeded_dep