1 project('All GStreamer modules', 'c',
3 meson_version : '>= 0.47.0',
4 default_options : ['buildtype=debugoptimized'])
6 gst_version = '>= @0@'.format(meson.project_version())
11 build_system = build_machine.system()
12 cc = meson.get_compiler('c')
14 # Make it possible to use msys2 built zlib which fails
15 # when not using the mingw toolchain as it uses unistd.h
16 if not meson.is_subproject() and cc.get_id() == 'msvc'
17 uname = find_program('uname', required: false)
19 ret = run_command(uname, '-o')
20 if ret.returncode() == 0 and ret.stdout().to_lower() == 'msys'
21 ret = run_command(uname, '-r')
22 # The kernel version returned by uname is actually the msys version
23 if ret.returncode() == 0 and ret.stdout().startswith('2')
24 # If a system zlib is found, disable UNIX features in zlib.h and zconf.h
25 if cc.find_library('z').found()
26 add_global_arguments('-DZ_SOLO', language: 'c')
33 libav_opt = get_option('libav')
34 libav_deps = [dependency('libavfilter', version: '>= 7.16.100',
35 fallback: ['FFmpeg', 'libavfilter_dep'], required: libav_opt)]
36 if libav_deps[0].found() and libav_deps[0].type_name() != 'internal'
37 cc = meson.get_compiler('c')
38 check_ffmpeg_src = '''#include <libavcodec/avcodec.h>
39 #if LIBAVCODEC_VERSION_MICRO >= 100
40 /* FFmpeg uses 100+ as its micro version */
42 #error libav provider should be FFmpeg
44 if not cc.compiles(check_ffmpeg_src, dependencies : libav_deps, name : 'whether libav is provided by FFmpeg')
45 message('WARNING: gst-libav not built as ffmpeg n3.1.2 not found on the system')
46 libav_deps += [disabler()]
50 if add_languages('cs', required : get_option('sharp'))
53 sharp_deps = [disabler()]
56 python_opt = get_option('python')
57 vaapi_opt = get_option('vaapi')
58 devtools_opt = get_option('devtools')
59 ges_opt = get_option('ges')
62 'gst-plugins-base': {},
63 'gst-plugins-good': {},
64 'gst-plugins-bad': { 'option': get_option('bad') },
65 'gst-plugins-ugly': { 'option': get_option('ugly') },
66 'gst-python': { 'option': python_opt, 'dependencies': [dependency('pygobject-3.0', required : python_opt)] },
67 'gst-omx': { 'option': get_option('omx'), },
68 'gst-libav': { 'option': get_option('libav'), 'dependencies': libav_deps},
71 'dependencies': [dependency('libva', version: ['>= 0.30.4', '!= 0.99.0'], required : vaapi_opt)]
74 'option': devtools_opt,
75 'dependencies': [dependency('json-glib-1.0', required: devtools_opt)],
77 'gst-editing-services': { 'option': ges_opt, 'dependencies': [dependency('libxml-2.0', required : ges_opt)] },
78 'gst-rtsp-server': { 'option': get_option('rtsp_server') },
79 'gstreamer-sharp': { 'option': get_option('sharp'), 'dependencies': sharp_deps },
82 python3 = import('python3').find_python()
86 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
87 os.path.join('@1@', '@0@'))
90 # On Windows, if flex/bison aren't found, we use a subproject to get them
91 flex = find_program('flex', 'win_flex', required : build_system != 'windows')
92 bison = find_program('bison', 'win_bison', required : build_system != 'windows')
93 if not flex.found() or not bison.found()
94 subproject('win-flex-bison-binaries')
97 subprojects_names = []
98 foreach project_name, build_infos: subprojects
100 if build_infos.has_key('option')
101 build = not build_infos.get('option').disabled()
103 foreach dep: build_infos.get('dependencies', [])
104 if dep.found() == false
105 warning('@0@ dependency @1@ not found - NOT BUILDING'.format(project_name, dep))
113 subprojects_names += [project_name]
114 subproject(project_name, version: gst_version)
115 cmdres = run_command(python3, '-c', symlink.format(project_name, meson.current_source_dir()))
116 if cmdres.returncode() == 0
117 message('Created symlink to ' + project_name)
122 foreach custom_subproj: get_option('custom_subprojects').split(',')
123 if custom_subproj != ''
124 message ('Adding custom subproject ' + custom_subproj)
125 subproject(custom_subproj)
126 subprojects_names += [custom_subproj]
130 message('Building subprojects: ' + ', '.join(subprojects_names))
132 setenv = find_program('gst-uninstalled.py')
133 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()),
134 '--srcdir=@0@'.format(meson.source_root())])
136 update = find_program('git-update')
137 run_target('git-update', command : [update])
138 run_target('update', command : [update,
139 '--builddir=@0@'.format(meson.current_build_dir())])