meson.build 681 B

12345678910111213141516171819202122232425
  1. project('generated llvm ir', 'c')
  2. if meson.get_compiler('c').get_id() != 'clang'
  3. error('MESON_SKIP_TEST: LLVM IR files can only be built with clang')
  4. endif
  5. copy = find_program('copyfile.py')
  6. copygen = generator(copy,
  7. arguments : ['@INPUT@', '@OUTPUT@'],
  8. output : '@BASENAME@')
  9. l = shared_library('square-gen', copygen.process('square.ll.in'))
  10. test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l))
  11. copyct = custom_target('square',
  12. input : 'square.ll.in',
  13. output : 'square.ll',
  14. command : [copy, '@INPUT@', '@OUTPUT@'])
  15. l = shared_library('square-ct', copyct)
  16. test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l))