gst-uninstalled: Fix compatibility with meson 0.50
[platform/upstream/gstreamer.git] / meson.build
1 project('All GStreamer modules', 'c',
2   version : '1.15.0.1',
3   meson_version : '>= 0.48.0',
4   default_options : ['buildtype=debugoptimized'])
5
6 gst_version = '>= @0@'.format(meson.project_version())
7 gst_branch = 'master'
8
9 glib_req = '>= 2.40.0'
10
11 build_system = build_machine.system()
12 cc = meson.get_compiler('c')
13
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)
18   if uname.found()
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')
27         endif
28       endif
29     endif
30   endif
31 endif
32
33 subprojects = {
34     'gstreamer': {},
35     'gst-plugins-base': {},
36     'gst-plugins-good': {},
37     'gst-plugins-bad': { 'option': get_option('bad') },
38     'gst-plugins-ugly': { 'option': get_option('ugly') },
39     'pygobject': { 'option': get_option('python') },
40     'gst-python': { 'option': get_option('python') },
41     'gst-omx': { 'option': get_option('omx'), },
42     'gst-libav': { 'option': get_option('libav') },
43     'gstreamer-vaapi': { 'option': get_option('vaapi') },
44     'gst-rtsp-server': { 'option': get_option('rtsp_server') },
45     'gst-devtools': { 'option': get_option('devtools') },
46     'gst-editing-services': { 'option': get_option('ges') },
47     'gstreamer-sharp': { 'option': get_option('sharp') },
48 }
49
50 python3 = import('python3').find_python()
51 symlink = '''
52 import os
53
54 os.symlink(os.path.join('@1@', 'subprojects', '@0@'),
55   os.path.join('@1@', '@0@'))
56 '''
57
58 if build_system == 'windows'
59   subproject('win-flex-bison-binaries')
60   subproject('win-nasm')
61 endif
62
63 subproject('orc', required: get_option('orc'))
64
65 subprojects_names = []
66 foreach project_name, build_infos: subprojects
67   is_required = build_infos.get('option', true)
68   subproj = subproject(project_name, version: gst_version, required: is_required)
69   if subproj.found()
70     subprojects_names += [project_name]
71     cmdres = run_command(python3, '-c', symlink.format(project_name, meson.current_source_dir()))
72     if cmdres.returncode() == 0
73         message('Created symlink to ' + project_name)
74     endif
75   endif
76 endforeach
77
78 foreach custom_subproj: get_option('custom_subprojects').split(',')
79     if custom_subproj != ''
80         message ('Adding custom subproject ' + custom_subproj)
81         subproject(custom_subproj)
82         subprojects_names += [custom_subproj]
83     endif
84 endforeach
85
86 message('Building subprojects: ' + ', '.join(subprojects_names))
87
88 setenv = find_program('gst-uninstalled.py')
89 run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()),
90            '--srcdir=@0@'.format(meson.source_root())])
91
92 update = find_program('git-update')
93 run_target('git-update', command : [update])
94 run_target('update', command : [update,
95     '--builddir=@0@'.format(meson.current_build_dir())])