• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dts_opt = get_option('dts').require(gpl_allowed, error_message: '''
2  Plugin dts explicitly required via options but GPL-licensed plugins disabled via options.
3  Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built.
4  ''')
5
6# Don't do any dependency checks if disabled
7if dts_opt.disabled()
8  subdir_done()
9endif
10
11# Detect libdca using a pkg-config file, or manually
12dca_dep = dependency('libdca', required : false)
13if not dca_dep.found()
14  if cc.has_header_symbol('dca.h', 'dca_init')
15    dca_dep = cc.find_library('dca', required : false)
16  endif
17  if not dca_dep.found() and dts_opt.enabled()
18    error('DTS plugin enabled, but libdca not found')
19  endif
20endif
21
22no_warn_c_args = []
23if cc.get_id() != 'msvc'
24  # autotools didn't use the libdca pkg-config cflags, and they
25  # can point to a non-existing location (/usr/include/dca)
26  no_warn_c_args = ['-Wno-missing-include-dirs']
27endif
28
29if dca_dep.found()
30  gstdtsdec = library('gstdtsdec',
31    'gstdtsdec.c',
32    c_args : gst_plugins_bad_args + no_warn_c_args,
33    link_args : noseh_link_args,
34    include_directories : [configinc, libsinc],
35    dependencies : [gstaudio_dep, orc_dep, dca_dep],
36    install : true,
37    install_dir : plugins_install_dir,
38  )
39  pkgconfig.generate(gstdtsdec, install_dir : plugins_pkgconfig_install_dir)
40  plugins += [gstdtsdec]
41endif
42