Debian Codegraph @

test cases/common/57 custom header generator/meson.build

raw
1 project('custom header generator', 'c')
2
3 cc_id = meson.get_compiler('c').get_id()
4 cc_ver = meson.get_compiler('c').version()
5
6 if cc_id == 'intel' or (cc_id == 'lcc' and cc_ver.version_compare('<=1.23.08'))
7 # ICC and LCC <= 1.23.08 do not escape spaces in paths in the dependency file, so Ninja
8 # (correctly) thinks that the rule has multiple outputs and errors out:
9 # 'depfile has multiple output paths'
10 error('MESON_SKIP_TEST: Skipping test because your compiler is known to generate broken dependency files')
11 endif
12
13 gen = find_program('makeheader.py')
14
15 generated_h = custom_target('makeheader.py',
16 output : 'myheader.lh', # Suffix not .h to ensure this works with custom suffixes, too.
17 input : 'input.def',
18 command : [gen, '@INPUT0@', '@OUTPUT0@', files('somefile.txt')])
19
20 prog = executable('prog', 'prog.c', generated_h)
21 test('gentest', prog)