Add 'update' and `git-update` targets to update git repos
[platform/upstream/gstreamer.git] / meson.build
1 project('All GStreamer modules', 'c', version : '1.9.90', meson_version : '>= 0.35.1')
2
3 gst_version = '>= @0@'.format(meson.project_version())
4 gst_branch = 'master'
5
6 glib_req = '>= 2.40.0'
7
8 subprojects = [
9     'gstreamer',
10     'gst-plugins-base',
11     'gst-plugins-good',
12 ]
13
14 # FIXME Remove that check once we have ffmpeg as a gst-libav subproject
15 libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: false)
16 gst_libav = []
17 if libavfilter_dep.found()
18     cc = meson.get_compiler('c')
19     check_ffmpeg_src = '''#include <libavcodec/avcodec.h>
20     #if LIBAVCODEC_VERSION_MICRO >= 100
21     /* FFmpeg uses 100+ as its micro version */
22     #else
23     #error libav provider should be FFmpeg
24     #endif'''
25     if cc.compiles(check_ffmpeg_src, dependencies : libavfilter_dep, name : 'whether libav is provided by FFmpeg')
26         gst_libav = ['gst-libav']
27     endif
28 endif
29
30 if gst_libav.length() == 0
31     message('WARNING: gst-libav not built as ffmpeg >= n3.1.2 not found on the system')
32 endif
33
34 if get_option('enable_python')
35     subprojects += ['gst-python']
36 endif
37
38 if not get_option('disable_gst_plugins_ugly')
39     subprojects += ['gst-plugins-ugly']
40 endif
41
42 if not get_option('disable_gst_plugins_bad')
43     subprojects += ['gst-plugins-bad']
44 endif
45
46 if not get_option('disable_gst_libav')
47     subprojects += gst_libav
48 endif
49
50 if not get_option('disable_gst_devtools')
51   if dependency('json-glib-1.0', required : false).found()
52     subprojects += ['gst-devtools']
53   else
54     message('WARNING: not building gst-devtools module, missing glib-json-1.0')
55   endif
56 endif
57
58 if not get_option('disable_gst_editing_services')
59     subprojects += ['gst-editing-services']
60 endif
61
62 if not get_option('disable_rtsp_server')
63     subprojects += ['gst-rtsp-server']
64 endif
65
66 python3 = find_program('python3')
67 symlink = '''
68 import os
69
70 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
71     os.path.join('@1@', '@0@'))
72 '''
73 foreach subproj: subprojects
74     subproject(subproj, version: gst_version)
75
76     cmdres = run_command(python3, '-c', symlink.format(subproj, meson.current_source_dir()))
77     if cmdres.returncode() == 0
78        message('Created symlink to ' + subproj)
79     else
80        message('Could not create symlink to @0@'.format(subproj))
81     endif
82 endforeach
83
84 setenv = find_program('gst-uninstalled.py')
85 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.current_build_dir()),
86            '--gst-version=@0@'.format(gst_branch)])
87
88 update = find_program('git-update')
89 run_target('git-update', command : [update])
90 run_target('update', command : [update,
91     '--builddir=@0@'.format(meson.current_build_dir())])