The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
9 years ago
|
project('extra args in gen', 'c')
|
||
|
|
||
|
prog = find_program('srcgen.py')
|
||
|
|
||
|
gen = generator(prog,
|
||
|
output : '@BASENAME@.c',
|
||
|
arguments : ['--input=@INPUT@', '--output=@OUTPUT@', '@EXTRA_ARGS@'])
|
||
|
|
||
|
g1 = gen.process('name.dat')
|
||
|
g2 = gen.process('name.dat', extra_args: '--upper')
|
||
|
|
||
|
test('basic', executable('basic', 'plain.c', g1))
|
||
|
test('upper', executable('upper', 'upper.c', g2))
|
||
7 years ago
|
|
||
7 years ago
|
prog2 = find_program('srcgen2.py')
|
||
|
basename_gen = generator(prog2,
|
||
|
output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
|
||
|
arguments : ['@BUILD_DIR@', '@BASENAME@', '@INPUT@'])
|
||
7 years ago
|
|
||
|
basename_src = basename_gen.process('name.l')
|
||
|
|
||
|
test('basename', executable('basename', basename_src))
|
||
|
|
||
7 years ago
|
plainname_gen = generator(prog2,
|
||
|
output : ['@PLAINNAME@.tab.c', '@PLAINNAME@.tab.h'],
|
||
|
arguments : ['@BUILD_DIR@', '@PLAINNAME@', '@INPUT@'])
|
||
7 years ago
|
|
||
|
plainname_src = plainname_gen.process('name.l')
|
||
|
|
||
|
test('plainname', executable('plainname', plainname_src))
|
||
7 years ago
|
|
||
|
prog3 = find_program('srcgen3.py')
|
||
|
capture_gen = generator(prog3,
|
||
|
output : ['@BASENAME@.yy.c'],
|
||
|
arguments : ['@INPUT@'],
|
||
|
capture : true)
|
||
|
|
||
|
capture_src = capture_gen.process('name.l')
|
||
|
|
||
|
test('capture', executable('capture', capture_src))
|