clock: Fix deprecation handling of the GstClock clock field
[platform/upstream/gstreamer.git] / gst / parse / meson.build
1 cc = meson.get_compiler('c')
2
3 # Find flex, configure lex generator
4 flex_cdata = configuration_data()
5
6 flex_min_version='2.5.31'
7 flex = find_program('flex', 'win_flex')
8
9 flexversion_res = run_command([flex, '--version'])
10 if flexversion_res.returncode() != 0
11   error('Could not get flex version (@0@)'.format(flexversion_res.stderr()))
12 endif
13
14 flexversion = flexversion_res.stdout().split('\n')[0].split(' ')[1].strip()
15 if flexversion.version_compare('<' + flex_min_version)
16   error('flex version @0@ >= @1@: NO'.format(flexversion, flex_min_version))
17 else
18   message('flex version @0@ >= @1@: YES'.format(flexversion, flex_min_version))
19 endif
20
21 flex_cdata.set('FLEX', flex.path())
22 if cc.get_id() == 'msvc'
23   flex_cdata.set('FLEX_ARGS', '--nounistd')
24 else
25   flex_cdata.set('FLEX_ARGS', '')
26 endif
27
28 gen_lex = configure_file(input : 'gen_lex.py.in',
29   output : 'gen_lex.py',
30   configuration : flex_cdata)
31
32 # Find bison, configure grammar generator
33 bison_cdata = configuration_data()
34
35 bison_min_version='2.4'
36 bison = find_program('bison', 'win_bison')
37
38 bversion_res = run_command([bison, '--version'])
39 if bversion_res.returncode() != 0
40   error('Could not get bison version (@0@)'.format(bversion_res.stderr()))
41 endif
42
43 bversion = bversion_res.stdout().split('\n')[0].split(' ')[-1].strip()
44 if bversion.version_compare('<' + bison_min_version)
45   error('bison version @0@ >= @1@: NO'.format(bversion, bison_min_version))
46 else
47   message('bison version @0@ >= @1@: YES'.format(bversion, bison_min_version))
48 endif
49
50
51
52 bison_cdata.set('BISON', bison.path())
53 bison_cdata.set('BISON_ARGS', '')
54
55 gen_grammar = configure_file(input : 'gen_grammar.py.in',
56   output : 'gen_grammar.py',
57   configuration : bison_cdata)
58
59 # Custom targets
60 parser = custom_target('parselex',
61   input : 'parse.l',
62   output : ['lex.priv_gst_parse_yy.c', 'parse_lex.h'],
63   command : [python3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
64 )
65
66 grammar = custom_target('parsegrammar',
67   input : 'grammar.y',
68   output : ['grammar.tab.c', 'grammar.tab.h'],
69   command : [python3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
70   depends : [parser],
71 )
72
73 gst_parse_sources += [parser, grammar]