af99bd564c30d256e21a74f032b4cd31d9f2d205
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / ext / mpeg2enc / meson.build
1 # mjpegtools upstream breaks API constantly and doesn't export the version in
2 # a header anywhere. The configure file has a lot of logic to support old
3 # versions, but it all seems untested and broken. Require 2.0.0. Can be changed
4 # if someone complains.
5 mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : get_option('mpeg2enc'))
6 mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : get_option('mpeg2enc'))
7
8 no_warn_args = []
9 foreach arg : [
10     '-Wno-mismatched-tags', # mjpeg headers get class/struct mixed up
11     '-Wno-header-guard',
12   ]
13   if cxx.has_argument(arg)
14     no_warn_args += [arg]
15   endif
16 endforeach
17
18 if mjpegtools_dep.found() and mpeg2enc_dep.found()
19   gstmpeg2enc = library('gstmpeg2enc',
20     'gstmpeg2enc.cc',
21     'gstmpeg2encoptions.cc',
22     'gstmpeg2encoder.cc',
23     'gstmpeg2encstreamwriter.cc',
24     'gstmpeg2encpicturereader.cc',
25     cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=20000'] + no_warn_args,
26     link_args : noseh_link_args,
27     include_directories : [configinc, libsinc],
28     dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep],
29     install : true,
30     install_dir : plugins_install_dir,
31   )
32   pkgconfig.generate(gstmpeg2enc, install_dir : plugins_pkgconfig_install_dir)
33   plugins += [gstmpeg2enc]
34 endif