| 1 |
project('c cpp and asm', 'c', 'cpp') |
| 2 |
|
| 3 |
cpu = host_machine.cpu_family() |
| 4 |
cc = meson.get_compiler('c') |
| 5 |
|
| 6 |
supported_cpus = ['arm', 'x86', 'x86_64'] |
| 7 |
|
| 8 |
if not supported_cpus.contains(cpu) |
| 9 |
error('MESON_SKIP_TEST unsupported cpu:' + cpu) |
| 10 |
endif |
| 11 |
|
| 12 |
if meson.get_compiler('c').get_argument_syntax() == 'msvc' |
| 13 |
error('MESON_SKIP_TEST MSVC can\'t compile assembly') |
| 14 |
endif |
| 15 |
|
| 16 |
if cc.symbols_have_underscore_prefix() |
| 17 |
add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language: 'c') |
| 18 |
endif |
| 19 |
|
| 20 |
test('test-c-asm', executable('c-asm', ['main.c', 'retval-' + cpu + '.S'])) |
| 21 |
test('test-cpp-asm', executable('cpp-asm', ['main.cpp', 'retval-' + cpu + '.S'])) |
| 22 |
test('test-c-cpp-asm', executable('c-cpp-asm', ['somelib.c', 'main.cpp', 'retval-' + cpu + '.S'])) |
| 23 |
test('test-cpp-c-asm', executable('cpp-c-asm', ['main.cpp', 'somelib.c', 'retval-' + cpu + '.S'])) |