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