Back to development
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / ext / dts / meson.build
1 dts_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
7 if dts_opt.disabled()
8   subdir_done()
9 endif
10
11 # Detect libdca using a pkg-config file, or manually
12 dca_dep = dependency('libdca', required : false)
13 if 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
20 endif
21
22 no_warn_c_args = []
23 if 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']
27 endif
28
29 if 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   plugins += [gstdtsdec]
40 endif