element: Enforce that elements created by gst_element_factory_create/make() are floating
[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 get_flex_version = find_program('get_flex_version.py')
10 flexversion_res = run_command([get_flex_version, flex], check: true)
11 flexversion = flexversion_res.stdout().strip()
12 if flexversion.version_compare('<' + flex_min_version)
13   error('flex version @0@ >= @1@: NO'.format(flexversion, flex_min_version))
14 else
15   message('flex version @0@ >= @1@: YES'.format(flexversion, flex_min_version))
16 endif
17
18 flex_cdata.set('FLEX', flex.path())
19 if cc.get_id() == 'msvc'
20   flex_cdata.set('FLEX_ARGS', '--nounistd')
21 else
22   flex_cdata.set('FLEX_ARGS', '')
23 endif
24
25 gen_lex = configure_file(input : 'gen_lex.py.in',
26   output : 'gen_lex.py',
27   configuration : flex_cdata)
28
29 # Find bison, configure grammar generator
30 bison_cdata = configuration_data()
31
32 bison_min_version='2.4'
33 bison = find_program('bison', 'win_bison')
34
35 bversion_res = run_command([bison, '--version'])
36 if bversion_res.returncode() != 0
37   error('Could not get bison version (@0@)'.format(bversion_res.stderr()))
38 endif
39
40 bversion = bversion_res.stdout().split('\n')[0].split(' ')[-1].strip()
41 if bversion.version_compare('<' + bison_min_version)
42   error('bison version @0@ >= @1@: NO'.format(bversion, bison_min_version))
43 else
44   message('bison version @0@ >= @1@: YES'.format(bversion, bison_min_version))
45 endif
46
47
48
49 bison_cdata.set('BISON', bison.path())
50 bison_cdata.set('BISON_ARGS', '')
51
52 gen_grammar = configure_file(input : 'gen_grammar.py.in',
53   output : 'gen_grammar.py',
54   configuration : bison_cdata)
55
56 # Custom targets
57 parser = custom_target('parselex',
58   input : 'parse.l',
59   output : ['lex.priv_gst_parse_yy.c', 'parse_lex.h'],
60   command : [python3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
61 )
62
63 grammar = custom_target('parsegrammar',
64   input : 'grammar.y',
65   output : ['grammar.tab.c', 'grammar.tab.h'],
66   command : [python3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
67   depends : [parser],
68 )
69
70 gst_parse_sources += [parser, grammar]