1 project('All GStreamer modules', 'c',
3 meson_version : '>= 0.46.0',
4 default_options : ['buildtype=debugoptimized'])
6 gst_version = '>= @0@'.format(meson.project_version())
17 cc = meson.get_compiler('c')
19 # Make it possible to use msys2 built zlib which fails
20 # when not using the mingw toolchain as it uses unistd.h
21 if not meson.is_subproject() and cc.get_id() == 'msvc'
22 uname = find_program('uname', required: false)
24 ret = run_command(uname, '-o')
25 if ret.returncode() == 0 and ret.stdout().to_lower() == 'msys'
26 ret = run_command(uname, '-r')
27 # The kernel version returned by uname is actually the msys version
28 if ret.returncode() == 0 and ret.stdout().startswith('2')
29 # If a system zlib is found, disable UNIX features in zlib.h and zconf.h
30 if cc.find_library('z').found()
31 add_global_arguments('-DZ_SOLO', language: 'c')
38 # FIXME Remove that check once we have ffmpeg as a gst-libav subproject
39 libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: false)
41 if libavfilter_dep.found()
42 cc = meson.get_compiler('c')
43 check_ffmpeg_src = '''#include <libavcodec/avcodec.h>
44 #if LIBAVCODEC_VERSION_MICRO >= 100
45 /* FFmpeg uses 100+ as its micro version */
47 #error libav provider should be FFmpeg
49 if cc.compiles(check_ffmpeg_src, dependencies : libavfilter_dep, name : 'whether libav is provided by FFmpeg')
50 gst_libav = ['gst-libav']
54 if gst_libav.length() == 0
55 message('WARNING: gst-libav not built as ffmpeg >= n3.1.2 not found on the system')
58 if get_option('enable_python')
59 subprojects += ['gst-python']
62 if not get_option('disable_gst_plugins_ugly')
63 subprojects += ['gst-plugins-ugly']
66 if not get_option('disable_gst_plugins_bad')
67 subprojects += ['gst-plugins-bad']
70 if not get_option('disable_gst_libav')
71 subprojects += gst_libav
74 if not get_option('disable_gst_omx')
75 subprojects += ['gst-omx']
78 if not get_option('disable_gstreamer_vaapi')
79 if dependency('libva', version: ['>= 0.30.4', '!= 0.99.0'], required : false).found()
80 subprojects += ['gstreamer-vaapi']
82 message('WARNING: not building gstreamer-vaapi module, missing libva')
86 if not get_option('disable_gst_devtools')
87 if dependency('json-glib-1.0', required : false).found()
88 subprojects += ['gst-devtools']
90 message('WARNING: not building gst-devtools module, missing glib-json-1.0')
94 if not get_option('disable_gst_editing_services')
95 if dependency('libxml-2.0', required : false).found()
96 subprojects += ['gst-editing-services']
98 message('WARNING: not building gst-editing-services module, missing libxml-2.0')
102 if not get_option('disable_rtsp_server')
103 subprojects += ['gst-rtsp-server']
106 if not get_option('disable_gstreamer_sharp')
107 if add_languages('cs', required : false)
108 if meson.version().version_compare('>=0.43')
109 subprojects += ['gstreamer-sharp']
111 message('WARNING: Not building gstreamer-sharp as meson >=0.43 not found.')
114 message('WARNING: Not building gstreamer-sharp as no CS compiler found.')
118 python3 = import('python3').find_python()
122 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
123 os.path.join('@1@', '@0@'))
126 foreach custom_subproj: get_option('custom_subprojects').split(',')
127 if custom_subproj != ''
128 message ('Adding custom subproject ' + custom_subproj)
129 subprojects += [custom_subproj]
133 message('Building subprojects: ' + ', '.join(subprojects))
134 foreach subproj: subprojects
136 if get_option('disable_introspection')
137 default_options += ['disable_introspection=true']
139 subproject(subproj, version: gst_version, default_options: default_options)
141 cmdres = run_command(python3, '-c', symlink.format(subproj, meson.current_source_dir()))
142 if cmdres.returncode() == 0
143 message('Created symlink to ' + subproj)
145 message('Could not create symlink to @0@'.format(subproj))
149 setenv = find_program('gst-uninstalled.py')
150 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()),
151 '--srcdir=@0@'.format(meson.source_root()),
152 '--gst-version=@0@'.format(gst_branch)])
154 update = find_program('git-update')
155 run_target('git-update', command : [update])
156 run_target('update', command : [update,
157 '--builddir=@0@'.format(meson.current_build_dir())])