Debian Codegraph @

test cases/common/129 build by default/meson.build

raw
1 project('build on all', 'c')
2
3 py3_mod = import('python3')
4 py3 = py3_mod.find_python()
5
6 executable('fooprog', 'foo.c',
7 build_by_default : false,
8 )
9
10 executable('barprog', 'foo.c',
11 build_by_default : false,
12 )
13
14 comp = files('mygen.py')
15 checkexists = files('checkexists.py')
16
17 mytarget = custom_target('gendat1',
18 output : 'generated1.dat',
19 input : 'source.txt',
20 command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
21 build_by_default : true,
22 )
23
24 mytarget = custom_target('gendat2',
25 output : 'generated2.dat',
26 input : 'source.txt',
27 command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
28 build_by_default : true,
29 build_always : false,
30 )
31
32 ct1_output = join_paths(meson.build_root(), 'generated1.dat')
33 ct2_output = join_paths(meson.build_root(), 'generated2.dat')
34 exe1_output = join_paths(meson.build_root(), 'fooprog')
35 exe2_output = join_paths(meson.build_root(), 'barprog')
36
37 if host_machine.system() == 'windows'
38 exe1_output += '.exe'
39 exe2_output += '.exe'
40 endif
41
42 test('check-build-by-default', py3,
43 args : [checkexists,
44 ct1_output, ct2_output, '--not', exe1_output, exe2_output])