1x11_dep = dependency('x11', required : get_option('ximagesrc'))
2
3if x11_dep.found()
4  x_args = []
5  xshm_dep = dependency('xext', required : get_option('ximagesrc-xshm'))
6  # FIXME: should add a 'required' arg to cc.has_function() in Meson and use it here
7  if xshm_dep.found() and cc.has_function('XShmAttach', dependencies: xshm_dep)
8    x_args += ['-DHAVE_XSHM']
9  endif
10
11  xfixes_dep = dependency('xfixes', required : get_option('ximagesrc-xfixes'))
12  if xfixes_dep.found()
13    x_args += ['-DHAVE_XFIXES']
14  endif
15
16  xdamage_dep = dependency('xdamage', required : get_option('ximagesrc-xdamage'))
17  if xdamage_dep.found()
18    x_args += ['-DHAVE_XDAMAGE']
19  endif
20
21  gstximagesrc = library('gstximagesrc',
22    'gstximagesrc.c', 'ximageutil.c',
23    c_args : gst_plugins_good_args + x_args,
24    include_directories : [configinc, libsinc],
25    dependencies : [gstbase_dep, gstvideo_dep, x11_dep,
26                    xshm_dep, xfixes_dep, xdamage_dep],
27    install : true,
28    install_dir : plugins_install_dir,
29  )
30  pkgconfig.generate(gstximagesrc, install_dir : plugins_pkgconfig_install_dir)
31endif
32