meson: fix build with GstGL from gst-plugins-base as subproject

- use right fallback variable
- get platform/winsys variables from subproject instead of pkg-config

With contributions from Thibault Saunier.
This commit is contained in:
Tim-Philipp Müller 2017-12-19 15:06:22 +00:00
parent cd2d5c140d
commit b7bfcc32d1

View file

@ -325,20 +325,31 @@ endif
# GStreamer OpenGL # GStreamer OpenGL
gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req, gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'gl_dep'], required: false) fallback : ['gst-plugins-base', 'gstgl_dep'], required: false)
build_gstgl = gstgl_dep.found() # FIXME: add option? build_gstgl = gstgl_dep.found() # FIXME: add option?
gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys') if build_gstgl
message('GStreamer OpenGL window systems: ' + gst_gl_winsys) if gstgl_dep.type_name() == 'pkg'
foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl'] gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys')
set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws)) gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms')
endforeach else
gstbase = subproject('gst-plugins-base')
gst_gl_winsys = ' '.join(gstbase.get_variable('enabled_gl_winsys'))
gst_gl_platforms = ' '.join(gstbase.get_variable('enabled_gl_platforms'))
endif
gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms') message('GStreamer OpenGL window systems: ' + gst_gl_winsys)
message('GStreamer OpenGL platforms: ' + gst_gl_platforms) message('GStreamer OpenGL platforms: ' + gst_gl_platforms)
foreach p : ['glx', 'egl', 'cgl', 'eagl']
set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p)) foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb']
endforeach set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws))
endforeach
foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl']
set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p))
endforeach
endif
libm = cc.find_library('m', required : false) libm = cc.find_library('m', required : false)
glib_dep = dependency('glib-2.0', version : glib_req, glib_dep = dependency('glib-2.0', version : glib_req,