From: Matthew Waters Date: Fri, 9 Sep 2016 13:24:01 +0000 (+1000) Subject: meson/gl: use separate deps for gl and glx X-Git-Tag: 1.16.2~955^2~253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f678dcaf2b586d9857f8404917b1fd7d659af89a;p=platform%2Fupstream%2Fgst-plugins-base.git meson/gl: use separate deps for gl and glx e.g. passing with_gl_api=gles2 would still build the glx code but not be linking against the libGL library which is where the glX* functions are located and would result in a linker error. Solved by checking for the libGL library if either opengl or glx may be needed and then disabling the corresponding deps as requested. --- diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build index f0e8bac..3db3875 100644 --- a/gst-libs/gst/gl/meson.build +++ b/gst-libs/gst/gl/meson.build @@ -208,7 +208,8 @@ gl_include_header = ''' # Desktop OpenGL checks gl_dep = unneeded_dep -if need_api_opengl != 'no' +glx_dep = unneeded_dep +if need_api_opengl != 'no' and need_platform_glx != 'no' gl_dep = dependency('GL', required : false) if not gl_dep.found() # if host_machine.system() == 'windows' @@ -224,6 +225,14 @@ if need_api_opengl != 'no' endif endif + glx_dep = gl_dep + if need_api_opengl == 'no' + gl_dep = unneeded_dep + endif + if need_platform_glx == 'no' + glx_dep = unneeded_dep + endif + opengl_includes = ''' #ifdef __APPLE__ # include @@ -423,13 +432,13 @@ if need_win_x11 != 'no' gl_winsys_deps += x11_dep enabled_gl_winsys += 'x11' - if need_platform_glx != 'no' + if need_platform_glx != 'no' and glx_dep.found() glconf.set('GST_GL_HAVE_PLATFORM_GLX', 1) gl_sources += [ 'x11/gstglcontext_glx.c', ] # GLX is in the opengl library on linux - gl_platform_deps += gl_dep + gl_platform_deps += glx_dep enabled_gl_platforms += 'glx' endif elif need_win_x11 == 'yes'