1 cc = meson.get_compiler('c')
3 # Find flex, configure lex generator
4 flex_cdata = configuration_data()
6 flex = find_program('flex', required : false)
8 flex = find_program('win_flex', required : false)
10 error('flex not found')
14 flex_cdata.set('FLEX', flex.path())
15 if cc.get_id() == 'msvc'
16 flex_cdata.set('FLEX_ARGS', '--nounistd')
18 flex_cdata.set('FLEX_ARGS', '')
21 gen_lex = configure_file(input : 'gen_lex.py.in',
22 output : 'gen_lex.py',
23 configuration : flex_cdata)
25 # Find bison, configure grammar generator
26 bison_cdata = configuration_data()
28 bison = find_program('bison', required : false)
30 bison = find_program('win_bison', required : false)
32 error('GNU bison not found')
36 bison_cdata.set('BISON', bison.path())
37 bison_cdata.set('BISON_ARGS', '')
39 gen_grammar = configure_file(input : 'gen_grammar.py.in',
40 output : 'gen_grammar.py',
41 configuration : bison_cdata)
44 parser = custom_target('parselex',
46 output : ['lex.priv_gst_parse_yy.c', 'parse_lex.h'],
47 command : [py3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
50 grammar = custom_target('parsegrammar',
52 output : ['grammar.tab.c', 'grammar.tab.h'],
53 command : [py3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],