Debian Codegraph @

test cases/common/245 custom target index source/meson.build

raw
1 project('custom target index source', 'c')
2
3 # Test that using a custom target index as a sourcefile works correctly
4
5 copy1 = find_program('copyfile.py')
6 copy2 = find_program('copyfile2.py')
7
8 step_1 = custom_target('step_1',
9 input: ['code_source.c', files('header_source.h')],
10 output: ['step_1.c', 'step_1.h'],
11 command: [copy2, '@INPUT0@', '@OUTPUT0@', '@INPUT1@', '@OUTPUT1@'],
12 build_by_default: false)
13
14 # test custom target with a single CustomTargetIndex input
15 step_2_c = custom_target('step_2_c',
16 input: step_1[0],
17 output: 'step_2.c',
18 command: [copy1, '@INPUT0@', '@OUTPUT0@'],
19 build_by_default: false)
20
21 step_2_h = custom_target('step_2_h',
22 input: step_1[1],
23 output: 'step_2.h',
24 command: [copy1, '@INPUT0@', '@OUTPUT0@'],
25 build_by_default: false,
26 )
27
28 # test custom target with multiple CustomTargetIndex inputs
29 gen = custom_target('step_3',
30 input: [step_2_c, step_2_h],
31 output: ['gen.c', 'gen.h'],
32 command: [copy2, '@INPUT0@', '@OUTPUT0@', '@INPUT1@', '@OUTPUT1@'],
33 build_by_default: false)
34 gen_c = gen[0]
35 gen_h = gen[1]
36
37 exe_separate = executable('exe_separate',
38 ['main.c', gen_c, gen_h],
39 build_by_default: false,
40 install: false,
41 )
42
43 exe_together = executable('exe_together',
44 ['main.c', gen],
45 build_by_default: false,
46 install: false,
47 )
48
49 # also cover passing custom target to tests as arguments
50 test('exe_separate', exe_separate, args: [gen_c, gen_h])
51 test('exe_together', exe_together, args: gen)