msys2: Fix special lib names regexes and add some necessary ones
[platform/upstream/gstreamer.git] / meson.build
1 project('All GStreamer modules', 'c', version : '1.11.0.1', meson_version : '>= 0.36')
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 cc = meson.get_compiler('c')
15 if not meson.is_subproject() and cc.get_id() == 'msvc'
16   # Make it possible to use msys2 built zlib
17   # which fails when not using the mingw toolchain as
18   # it uses unistd.h
19   add_global_arguments('-DZ_SOLO', language: 'c')
20 endif
21
22 # FIXME Remove that check once we have ffmpeg as a gst-libav subproject
23 libavfilter_dep = dependency('libavfilter', version: '>= 6.47.100', required: false)
24 gst_libav = []
25 if libavfilter_dep.found()
26     cc = meson.get_compiler('c')
27     check_ffmpeg_src = '''#include <libavcodec/avcodec.h>
28     #if LIBAVCODEC_VERSION_MICRO >= 100
29     /* FFmpeg uses 100+ as its micro version */
30     #else
31     #error libav provider should be FFmpeg
32     #endif'''
33     if cc.compiles(check_ffmpeg_src, dependencies : libavfilter_dep, name : 'whether libav is provided by FFmpeg')
34         gst_libav = ['gst-libav']
35     endif
36 endif
37
38 if gst_libav.length() == 0
39     message('WARNING: gst-libav not built as ffmpeg >= n3.1.2 not found on the system')
40 endif
41
42 if get_option('enable_python')
43     subprojects += ['gst-python']
44 endif
45
46 if not get_option('disable_gst_plugins_ugly')
47     subprojects += ['gst-plugins-ugly']
48 endif
49
50 if not get_option('disable_gst_plugins_bad')
51     subprojects += ['gst-plugins-bad']
52 endif
53
54 if not get_option('disable_gst_libav')
55     subprojects += gst_libav
56 endif
57
58 if not get_option('disable_gst_devtools')
59   if dependency('json-glib-1.0', required : false).found()
60     subprojects += ['gst-devtools']
61   else
62     message('WARNING: not building gst-devtools module, missing glib-json-1.0')
63   endif
64 endif
65
66 if not get_option('disable_gst_editing_services')
67     subprojects += ['gst-editing-services']
68 endif
69
70 if not get_option('disable_rtsp_server')
71     subprojects += ['gst-rtsp-server']
72 endif
73
74 python3 = find_program('python3')
75 symlink = '''
76 import os
77
78 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
79     os.path.join('@1@', '@0@'))
80 '''
81 foreach subproj: subprojects
82     subproject(subproj, version: gst_version)
83
84     cmdres = run_command(python3, '-c', symlink.format(subproj, meson.current_source_dir()))
85     if cmdres.returncode() == 0
86        message('Created symlink to ' + subproj)
87     else
88        message('Could not create symlink to @0@'.format(subproj))
89     endif
90 endforeach
91
92 setenv = find_program('gst-uninstalled.py')
93 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.current_build_dir()),
94            '--gst-version=@0@'.format(gst_branch)])
95
96 update = find_program('git-update')
97 run_target('git-update', command : [update])
98 run_target('update', command : [update,
99     '--builddir=@0@'.format(meson.current_build_dir())])