mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
b2f9808722
https://github.com/mesonbuild/meson With contributions from: Tim-Philipp Müller <tim@centricular.com> Mathieu Duponchelle <mathieu.duponchelle@opencreed.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.
61 lines
1.5 KiB
Meson
61 lines
1.5 KiB
Meson
cc = meson.get_compiler('c')
|
|
|
|
py3 = find_program('python3', required : false)
|
|
if not py3.found()
|
|
# Maybe 'python' is Python 3
|
|
py3 = find_program('python')
|
|
endif
|
|
|
|
# Find flex, configure lex generator
|
|
flex_cdata = configuration_data()
|
|
|
|
flex = find_program('flex', required : false)
|
|
if not flex.found()
|
|
flex = find_program('win_flex', required : false)
|
|
if not flex.found()
|
|
error('flex not found')
|
|
endif
|
|
endif
|
|
|
|
flex_cdata.set('FLEX', flex.path())
|
|
if cc.get_id() == 'msvc'
|
|
flex_cdata.set('FLEX_ARGS', '--nounistd')
|
|
else
|
|
flex_cdata.set('FLEX_ARGS', '')
|
|
endif
|
|
|
|
gen_lex = configure_file(input : 'gen_lex.py.in',
|
|
output : 'gen_lex.py',
|
|
configuration : flex_cdata)
|
|
|
|
# Find bison, configure grammar generator
|
|
bison_cdata = configuration_data()
|
|
|
|
bison = find_program('bison', required : false)
|
|
if not bison.found()
|
|
bison = find_program('win_bison', required : false)
|
|
if not bison.found()
|
|
error('GNU bison not found')
|
|
endif
|
|
endif
|
|
|
|
bison_cdata.set('BISON', bison.path())
|
|
bison_cdata.set('BISON_ARGS', '')
|
|
|
|
gen_grammar = configure_file(input : 'gen_grammar.py.in',
|
|
output : 'gen_grammar.py',
|
|
configuration : bison_cdata)
|
|
|
|
# Custom targets
|
|
parser = custom_target('parselex',
|
|
input : 'parse.l',
|
|
output : ['lex.priv_gst_parse_yy.c', 'parse_lex.h'],
|
|
command : [py3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
|
|
)
|
|
|
|
grammar = custom_target('parsegrammar',
|
|
input : 'grammar.y',
|
|
output : ['grammar.tab.c', 'grammar.tab.h'],
|
|
command : [py3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
|
|
depends : [parser],
|
|
)
|