| 1 |
project('custom target feed') |
| 2 |
|
| 3 |
python3 = import('python3').find_python() |
| 4 |
|
| 5 |
# Note that this will not add a dependency to the compiler executable. |
| 6 |
# Code will not be rebuilt if it changes. |
| 7 |
comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') |
| 8 |
|
| 9 |
mytarget = custom_target('bindat', |
| 10 |
output : 'data.dat', |
| 11 |
input : 'data_source.txt', |
| 12 |
feed : true, |
| 13 |
command : [python3, comp, '@OUTPUT@'], |
| 14 |
install : true, |
| 15 |
install_dir : 'subdir' |
| 16 |
) |
| 17 |
|
| 18 |
ct_output_exists = '''import os, sys |
| 19 |
if not os.path.exists(sys.argv[1]): |
| 20 |
print("could not find {!r} in {!r}".format(sys.argv[1], os.getcwd())) |
| 21 |
sys.exit(1) |
| 22 |
''' |
| 23 |
|
| 24 |
test('capture-wrote', python3, args : ['-c', ct_output_exists, mytarget]) |