Commit b09f478e authored by Nirbheek Chauhan's avatar Nirbheek Chauhan Committed by Tim-Philipp Müller

Add support for Meson as alternative/parallel build system

https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
parent 655856de
aclocal.m4
autom4te.cache
config.h*
config.h
config.h.in
config.h-new
config.log
config.status
config.guess
......@@ -61,3 +63,6 @@ Build
/test-driver
*.log
*.trs
/build
/subprojects
This diff is collapsed.
cairo_dep = dependency('cairo-gobject', version : '>=1.10.0', required : false)
if cairo_dep.found()
gstcairo = library('gstcairo',
'gstcairo.c', 'gstcairooverlay.c',
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, cairo_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
dv_sources = [
'gstdv.c',
'gstdvdec.c',
'gstdvdemux.c',
'gstsmptetimecode.c',
'smpte_test.c',
]
dv_dep = dependency('libdv', version : '>= 0.100', required : false)
if dv_dep.found()
gstdv = library('gstdv',
dv_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, gstvideo_dep, dv_dep],
install : true,
install_dir : plugins_install_dir,
)
#executable('smpte_test',
# 'smpte_test.c', 'gstsmptetimecode.c',
# dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, gstvideo_dep, dv_dep],
# install : false)
endif
flac_sources = [
'gstflac.c',
'gstflacdec.c',
'gstflacenc.c',
'gstflactag.c',
]
flac_dep = dependency('flac', version : '>=1.1.4', required : false)
if flac_dep.found()
gstflac = library('gstflac',
flac_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, flac_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
pixbuf_sources = [
'gstgdkpixbufdec.c',
'gstgdkpixbufoverlay.c',
'gstgdkpixbufplugin.c',
'gstgdkpixbufsink.c',
]
gdkpixbuf_dep = dependency('gdk-pixbuf-2.0', version : '>=2.8.0', required : false)
if gdkpixbuf_dep.found()
gstgdkpixbuf = library('gstgdkpixbuf',
pixbuf_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, gstcontroller_dep, gdkpixbuf_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
jack_sources = [
'gstjackaudioclient.c',
'gstjackaudiosink.c',
'gstjackaudiosrc.c',
'gstjack.c',
'gstjackutil.c',
]
libjack_dep = dependency('jack', version : '>= 1.9.7', required : false)
if libjack_dep.found()
gstjack = library('gstjack',
jack_sources,
c_args : gst_plugins_good_args + ['-DHAVE_JACK_1_9_7'],
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstaudio_dep, libjack_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
jpeg_sources = [
'gstjpeg.c',
'gstjpegenc.c',
'gstjpegdec.c',
]
jpeglib = cc.find_library('jpeg', required : false)
if jpeglib.found()
gstjpeg = library('gstjpeg',
jpeg_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstvideo_dep, jpeglib, libm],
install : true,
install_dir : plugins_install_dir,
)
endif
png_sources = [
'gstpng.c',
'gstpngenc.c',
'gstpngdec.c',
]
libpng_dep = dependency('libpng', version : '>=1.2', required : false)
if libpng_dep.found()
gstpng = library('gstpng',
png_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gstvideo_dep, libpng_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
# subdir('aalib')
subdir('cairo')
subdir('flac')
subdir('gdk_pixbuf')
subdir('jack')
subdir('jpeg')
# subdir('libcaca')
# FIXME: dv plugin fails to link with msvc, wants pthread.lib
if cc.get_id() != 'msvc'
subdir('dv')
endif
subdir('libpng')
# subdir('raw1394')
subdir('pulse')
subdir('shout2')
subdir('soup')
subdir('speex')
# FIXME: taglib fails to compile and link with msvc
if cc.get_id() != 'msvc'
subdir('taglib')
endif
subdir('vpx')
subdir('wavpack')
pulse_sources = [
'plugin.c',
'pulsesink.c',
'pulsesrc.c',
'pulsedeviceprovider.c',
'pulseutil.c',
]
libpulse_dep = dependency('libpulse', version : '>=2.0', required : false)
if libpulse_dep.found()
gstpulse = library('gstpulse',
pulse_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstaudio_dep, gstpbutils_dep, libpulse_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
shout2_sources = ['gstshout2.c']
shout2_dep = dependency('shout', version : '>= 2.0', required : false)
if shout2_dep.found()
gstshout2 = library('gstshout2',
shout2_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, shout2_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
soup_sources = [
'gstsouphttpsrc.c',
'gstsouphttpclientsink.c',
'gstsouputils.c',
'gstsoup.c',
]
soup_args = [
'-DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_48',
'-DSOUP_VERSION_MAX_ALLOWED=SOUP_DEPRECATED_IN_2_48',
]
libsoup_dep = dependency('libsoup-2.4', version : '>=2.48', required : false)
if libsoup_dep.found()
gstsouphttpsrc = library('gstsouphttpsrc',
soup_sources,
c_args : gst_plugins_good_args + soup_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gsttag_dep, libsoup_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
speex_sources = [
'gstspeex.c',
'gstspeexdec.c',
'gstspeexenc.c',
]
speex_dep = dependency('speex', version : '>=1.1.6', required : false)
if speex_dep.found()
gstspeex = library('gstspeex',
speex_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, speex_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
endif
taglib_sources = [
'gstapev2mux.cc',
'gstid3v2mux.cc',
'gsttaglibplugin.c',
]
taglib_dep = dependency('taglib', version : '>= 1.5', required : false)
if taglib_dep.found() and add_languages('cpp')
gsttaglib = library('gsttaglib',
taglib_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
include_directories : [configinc, libsinc],
dependencies : [gsttag_dep, taglib_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
vpx_sources = [
'gstvp8dec.c',
'gstvp8enc.c',
'gstvp8utils.c',
'gstvp9dec.c',
'gstvp9enc.c',
'gstvpxdec.c',
'gstvpxenc.c',
'plugin.c',
]
vpx_features = [
[ 'vpx/vp8cx.h', 'vpx_codec_vp8_cx_algo', '-DHAVE_VP8_ENCODER', 'VP8 encoder' ],
[ 'vpx/vp8dx.h', 'vpx_codec_vp8_dx_algo', '-DHAVE_VP8_DECODER', 'VP8 decoder' ],
[ 'vpx/vp8cx.h', 'vpx_codec_vp9_cx_algo', '-DHAVE_VP9_ENCODER', 'VP9 encoder' ],
[ 'vpx/vp8dx.h', 'vpx_codec_vp9_dx_algo', '-DHAVE_VP9_DECODER', 'VP9 decoder' ],
]
vpx_dep = dependency('vpx', version : '>=1.3.0', required : false)
if vpx_dep.found()
vpx_args = []
foreach f : vpx_features
header = f.get(0)
codec_iface = f.get(1)
extra_define = f.get(2)
link_code = '''#include <@0@>
int main (int a, char ** g) {
const vpx_codec_iface_t *c = &@1@;
return c != 0;
}'''.format(header,codec_iface)
# FIXME: should take dependencies : vpx_dep argument
if cc.links(link_code, args : ['-lvpx'])
vpx_args += extra_define
message('libvpx provides @0@ interface (@1@)'.format(f.get(3),f.get(1)))
else
message('libvpx does not provide @0@ interface (@1@)'.format(f.get(3),f.get(1)))
endif
endforeach
if vpx_args.length() == 0
message('WARNING: libvpx was built without any encoder or decoder features!')
endif
if dependency('vpx', version : '>=1.4.0').found()
vpx_args += '-DHAVE_VPX_1_4'
endif
gstvpx = library('gstvpx',
vpx_sources,
c_args : gst_plugins_good_args + vpx_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gsttag_dep, gstvideo_dep, vpx_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
wavpack_sources = [
'gstwavpack.c',
'gstwavpackcommon.c',
'gstwavpackdec.c',
'gstwavpackenc.c',
'gstwavpackstreamreader.c',
]
wavpack_dep = dependency('wavpack', version : '>= 4.60.0', required : false)
if wavpack_dep.found()
gstwavpack = library('gstwavpack',
wavpack_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gstaudio_dep, wavpack_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
gstalpha = library('gstalpha', 'gstalpha.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, gst_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
gstalphacolor = library('gstalphacolor', 'gstalphacolor.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, gst_dep],
install : true,
install_dir : plugins_install_dir,
)
gstapetag = library('gstapetag', 'gstapedemux.c',
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstpbutils_dep, gsttag_dep, gst_dep],
install : true,
install_dir : plugins_install_dir,
)
audiofx_sources = [
'audiofx.c',
'audiopanorama.c',
'audioinvert.c',
'audioamplify.c',
'audiodynamic.c',
'audiokaraoke.c',
'audiofxbaseiirfilter.c',
'audiocheblimit.c',
'audiochebband.c',
'audioiirfilter.c',
'audiofxbasefirfilter.c',
'audiowsincband.c',
'audiowsinclimit.c',
'audiofirfilter.c',
'audioecho.c',
'gstscaletempo.c'
]
orcsrc = 'audiopanoramaorc'
if have_orcc
orc_h = custom_target(orcsrc + '.h',
input : orcsrc + '.orc',
output : orcsrc + '.h',
command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@'])
orc_c = custom_target(orcsrc + '.c',
input : orcsrc + '.orc',
output : orcsrc + '.c',
command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@'])
else
orc_h = configure_file(input : orcsrc + '-dist.h',
output : orcsrc + '.h',
configuration : configuration_data())
orc_c = configure_file(input : orcsrc + '-dist.c',
output : orcsrc + '.c',
configuration : configuration_data())
endif
gstaudiofx = library('gstaudiofx',
audiofx_sources, orc_c, orc_h,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [orc_dep, gstaudio_dep, gstfft_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
audioparsers_src = [
'gstaacparse.c',
'gstamrparse.c',
'gstac3parse.c',
'gstdcaparse.c',
'gstflacparse.c',
'gstmpegaudioparse.c',
'gstsbcparse.c',
'gstwavpackparse.c',
'plugin.c',
]
gstaudioparsers = library('gstaudioparsers',
audioparsers_src,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gst_dep, gstbase_dep, gstpbutils_dep,
gstaudio_dep, gsttag_dep],
install : true,
install_dir : plugins_install_dir,
)
gstauparse = library('gstauparse',
'gstauparse.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstaudio_dep, gstbase_dep],
install : true,
install_dir : plugins_install_dir,
)
autodetect_sources = [
'gstautoaudiosink.c',
'gstautoaudiosrc.c',
'gstautodetect.c',
'gstautovideosink.c',
'gstautovideosrc.c',
]
gstautodetect = library('gstautodetect',
autodetect_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gst_dep],
install : true,
install_dir : plugins_install_dir,
)
avi_sources = [
'gstavi.c',
'gstavimux.c',
'gstavidemux.c',
'gstavisubtitle.c'
]
gstavi = library('gstavi',
avi_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstriff_dep, gstaudio_dep, gstvideo_dep, gsttag_dep],
install : true,
install_dir : plugins_install_dir,
)
gstcutter = library('gstcutter', 'gstcutter.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstaudio_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
gstnavigationtest = library('gstnavigationtest',
'gstnavigationtest.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
gstdebug = library('gstdebug',
'gstdebug.c',
'breakmydata.c',
'gstcapssetter.c',
'gstnavseek.c',
'gstpushfilesrc.c',
'gsttaginject.c',
'rndbuffersize.c',
'progressreport.c',
'tests.c',
'cpureport.c',
'testplugin.c',
c_args: gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gst_dep, gstbase_dep, gstvideo_dep],
install : true,
install_dir : plugins_install_dir,
)
interlace_sources = [
'gstdeinterlace.c',
'gstdeinterlacemethod.c',
'tvtime/tomsmocomp.c',
'tvtime/greedy.c',
'tvtime/greedyh.c',
'tvtime/vfir.c',
'tvtime/weavetff.c',
'tvtime/weavebff.c',
'tvtime/weave.c',
'tvtime/linear.c',
'tvtime/linearblend.c',
'tvtime/scalerbob.c'
]
orcsrc = 'tvtime'
if have_orcc
orc_h = custom_target(orcsrc + '.h',
input : orcsrc + '.orc',
output : orcsrc + '.h',
command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@'])
orc_c = custom_target(orcsrc + '.c',
input : orcsrc + '.orc',
output : orcsrc + '.c',
command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@'])
else
orc_h = configure_file(input : orcsrc + '-dist.h',
output : orcsrc + '.h',
configuration : configuration_data())
orc_c = configure_file(input : orcsrc + '-dist.c',
output : orcsrc + '.c',
configuration : configuration_data())
endif
gstdeinterlace = library('gstdeinterlace',
interlace_sources, orc_c, orc_h,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [orc_dep, gstbase_dep, gstvideo_dep],
install : true,
install_dir : plugins_install_dir,
)
dtmf_sources = [
'gstdtmfsrc.c',
'gstrtpdtmfsrc.c',
'gstrtpdtmfdepay.c',
'gstdtmf.c'
]
gstdtmf = library('gstdtmf',
dtmf_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstrtp_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
effect_sources = [
'gsteffectv.c', 'gstedge.c', 'gstaging.c', 'gstdice.c', 'gstwarp.c',
'gstshagadelic.c', 'gstvertigo.c', 'gstrev.c', 'gstquark.c', 'gstop.c',
'gstradioac.c', 'gststreak.c', 'gstripple.c'
]
gsteffectv = library('gsteffectv',
effect_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gst_dep, gstbase_dep, gstvideo_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
eq_sources = [
'gstiirequalizer.c',
'gstiirequalizernbands.c',
'gstiirequalizer3bands.c',
'gstiirequalizer10bands.c',
]
gstequalizer = library('gstequalizer',
eq_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gstaudio_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
gstflv = library('gstflv',
'gstflvdemux.c', 'gstflvmux.c',
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstpbutils_dep, gstvideo_dep, gsttag_dep, gstaudio_dep],
install : true,
install_dir : plugins_install_dir,
)
flxdec = library('gstflxdec',
'gstflxdec.c', 'flx_color.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, gst_dep],
install : true,
install_dir : plugins_install_dir,
)
goom_sources = [
'gstgoom.c',
'drawmethods.c',
'sound_tester.c',
'mathtools.c',
'lines.c',
'ifs.c',
'surf3d.c',
'tentacle3d.c',
'v3d.c',
'convolve_fx.c',
'flying_stars_fx.c',
'plugin_info.c',
'goom_tools.c',
'config_param.c',
'filters.c',
'goom_core.c',
'graphic.c',
]
gstgoom = library('gstgoom',
goom_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gst_dep, gstpbutils_dep, gstbase_dep, orc_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
goom2k1_args = [
'-Dgst_goom_get_type=gst_goom2k1_get_type',
'-Dgoom_init=goom2k1_init',
'-Dgoom_close=goom2k1_close',
'-Dgoom_update=goom2k1_update',
'-Dgoom_set_resolution=goom2k1_set_resolution',
'-Dgoom_lines=goom2k1_lines',
'-DBLACK=GOOM2K1_BLACK',
'-DWHITE=GOOM2K1_WHITE',
'-DRED=GOOM2K1_RED',
'-DBLUE=GOOM2K1_BLUE',
'-DGREEN=GOOM2K1_GREEN',
'-DYELLOW=GOOM2K1_YELLOW',
'-DORANGE=GOOM2K1_ORANGE',
'-DVIOLET=GOOM2K1_VIOLET',
'-DzoomFilterFastRGB=zoomFilterFastRGB2k1',
'-DpointFilter=pointFilter2k1',
'-DzoomFilterDestroy=zoomFilterDestroy2k1',
'-DzoomFilterNew=zoomFilterNew2k1'
]
filter_args = ['-UMMX', '-UUSE_ASM']
goom2k1_sources = [
'gstgoom.c',
'goom_core.c',
'filters.c',
'graphic.c',
'lines.c'
]
gstgoom2k1 = library('gstgoom2k1',
goom2k1_sources,
c_args : gst_plugins_good_args + goom2k1_args + filter_args,
include_directories : [configinc],
dependencies : [gstpbutils_dep, gstbase_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
gsticydemux = library('gsticydemux',
'gsticydemux.c',
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gsttag_dep, zlib_dep],
install : true,
install_dir : plugins_install_dir,
)
gstid3demux = library('gstid3demux',
'gstid3demux.c',
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gsttag_dep, gstpbutils_dep],
install : true,
install_dir : plugins_install_dir,
)
gstimagefreeze = library('gstimagefreeze',
'gstimagefreeze.c',
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : glib_deps + [gst_dep],
install : true,
install_dir : plugins_install_dir,
)
gstinterleave = library('gstinterleave',
'plugin.c', 'interleave.c', 'deinterleave.c',
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstaudio_dep],
install : true,
install_dir : plugins_install_dir,