| 1 |
project('generated llvm ir', 'c') |
| 2 |
|
| 3 |
if meson.get_compiler('c').get_id() != 'clang' |
| 4 |
error('MESON_SKIP_TEST: LLVM IR files can only be built with clang') |
| 5 |
endif |
| 6 |
|
| 7 |
if meson.backend() == 'xcode' |
| 8 |
error('MESON_SKIP_TEST: LLVM ir not supported with the Xcode backend. Patches welcome.') |
| 9 |
endif |
| 10 |
|
| 11 |
copy = find_program('copyfile.py') |
| 12 |
|
| 13 |
copygen = generator(copy, |
| 14 |
arguments : ['@INPUT@', '@OUTPUT@'], |
| 15 |
output : '@BASENAME@') |
| 16 |
|
| 17 |
l = library('square-gen', copygen.process('square.ll.in')) |
| 18 |
|
| 19 |
test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) |
| 20 |
|
| 21 |
copyct = custom_target('square', |
| 22 |
input : 'square.ll.in', |
| 23 |
output : 'square.ll', |
| 24 |
command : [copy, '@INPUT@', '@OUTPUT@']) |
| 25 |
|
| 26 |
l = library('square-ct', copyct) |
| 27 |
|
| 28 |
test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) |