meson.build 861 B

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