meson.build 787 B

12345678910111213141516171819202122232425262728293031323334
  1. project('flex and bison', 'c')
  2. # The point of this test is that one generator
  3. # may output headers that are necessary to build
  4. # the sources of a different generator.
  5. flex = find_program('flex', required: false)
  6. bison = find_program('bison', required: false)
  7. if not flex.found()
  8. error('MESON_SKIP_TEST flex not found.')
  9. endif
  10. if not bison.found()
  11. error('MESON_SKIP_TEST bison not found.')
  12. endif
  13. lgen = generator(flex,
  14. output : '@PLAINNAME@.yy.c',
  15. arguments : ['-o', '@OUTPUT@', '@INPUT@'])
  16. lfiles = lgen.process('lexer.l')
  17. pgen = generator(bison,
  18. output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
  19. arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
  20. pfiles = pgen.process('parser.y')
  21. e = executable('pgen', 'prog.c',
  22. lfiles, pfiles)
  23. test('parsertest', e)