Debian Codegraph @

test cases/common/109 custom target capture/meson.build

raw
1 project('custom target')
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 capture : true,
13 command : [python3, comp, '@INPUT@'],
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])
25
26 mytarget = custom_target('bindat',
27 output : 'data.dat',
28 input : 'data_source.txt',
29 build_subdir : 'subdir2',
30 capture : true,
31 command : [python3, comp, '@INPUT@'],
32 install : true,
33 install_dir : 'subdir2'
34 )