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 build_system = build_machine.system()
18 cc = meson.get_compiler('c')
20 # Make it possible to use msys2 built zlib which fails
21 # when not using the mingw toolchain as it uses unistd.h
22 if not meson.is_subproject() and cc.get_id() == 'msvc'
23 uname = find_program('uname', required: false)
25 ret = run_command(uname, '-o')
26 if ret.returncode() == 0 and ret.stdout().to_lower() == 'msys'
27 ret = run_command(uname, '-r')
28 # The kernel version returned by uname is actually the msys version
29 if ret.returncode() == 0 and ret.stdout().startswith('2')
30 # If a system zlib is found, disable UNIX features in zlib.h and zconf.h
31 if cc.find_library('z').found()
32 add_global_arguments('-DZ_SOLO', language: 'c')
39 # FIXME Remove that check once we have ffmpeg as a gst-libav subproject
40 libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: false)
42 if libavfilter_dep.found()
43 cc = meson.get_compiler('c')
44 check_ffmpeg_src = '''#include <libavcodec/avcodec.h>
45 #if LIBAVCODEC_VERSION_MICRO >= 100
46 /* FFmpeg uses 100+ as its micro version */
48 #error libav provider should be FFmpeg
50 if cc.compiles(check_ffmpeg_src, dependencies : libavfilter_dep, name : 'whether libav is provided by FFmpeg')
51 gst_libav = ['gst-libav']
55 if gst_libav.length() == 0
56 message('WARNING: gst-libav not built as ffmpeg >= n3.1.2 not found on the system')
59 if get_option('python')
60 subprojects += ['gst-python']
64 subprojects += ['gst-plugins-bad']
68 subprojects += ['gst-plugins-ugly']
71 if get_option('libav')
72 subprojects += gst_libav
76 subprojects += ['gst-omx']
79 if get_option('vaapi')
80 if dependency('libva', version: ['>= 0.30.4', '!= 0.99.0'], required : false).found()
81 subprojects += ['gstreamer-vaapi']
83 message('WARNING: not building gstreamer-vaapi module, missing libva')
87 if get_option('devtools')
88 if dependency('json-glib-1.0', required : false).found()
89 subprojects += ['gst-devtools']
91 message('WARNING: not building gst-devtools module, missing glib-json-1.0')
96 if dependency('libxml-2.0', required : false).found()
97 subprojects += ['gst-editing-services']
99 message('WARNING: not building gst-editing-services module, missing libxml-2.0')
103 if get_option('rtsp_server')
104 subprojects += ['gst-rtsp-server']
107 if get_option('sharp')
108 if add_languages('cs', required : false)
109 if meson.version().version_compare('>=0.43')
110 subprojects += ['gstreamer-sharp']
112 message('WARNING: Not building gstreamer-sharp as meson >=0.43 not found.')
115 message('WARNING: Not building gstreamer-sharp as no CS compiler found.')
119 python3 = import('python3').find_python()
123 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
124 os.path.join('@1@', '@0@'))
127 foreach custom_subproj: get_option('custom_subprojects').split(',')
128 if custom_subproj != ''
129 message ('Adding custom subproject ' + custom_subproj)
130 subprojects += [custom_subproj]
134 # On Windows, if flex/bison aren't found, we use a subproject to get them
135 flex = find_program('flex', 'win_flex', required : build_system != 'windows')
136 bison = find_program('bison', 'win_bison', required : build_system != 'windows')
137 if not flex.found() or not bison.found()
138 subproject('win-flex-bison-binaries')
141 message('Building subprojects: ' + ', '.join(subprojects))
142 foreach subproj: subprojects
143 subproject(subproj, version: gst_version)
145 cmdres = run_command(python3, '-c', symlink.format(subproj, meson.current_source_dir()))
146 if cmdres.returncode() == 0
147 message('Created symlink to ' + subproj)
149 message('Could not create symlink to @0@'.format(subproj))
153 setenv = find_program('gst-uninstalled.py')
154 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()),
155 '--srcdir=@0@'.format(meson.source_root()),
156 '--gst-version=@0@'.format(gst_branch)])
158 update = find_program('git-update')
159 run_target('git-update', command : [update])
160 run_target('update', command : [update,
161 '--builddir=@0@'.format(meson.current_build_dir())])