The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
8 years ago
|
project('generated assembly', 'c')
|
||
|
|
||
|
cc = meson.get_compiler('c')
|
||
|
|
||
|
if cc.get_id() == 'msvc'
|
||
|
error('MESON_SKIP_TEST: assembly files cannot be compiled directly by MSVC')
|
||
|
endif
|
||
|
|
||
|
cpu = host_machine.cpu_family()
|
||
|
supported_cpus = ['arm', 'x86', 'x86_64']
|
||
|
|
||
|
if not supported_cpus.contains(cpu)
|
||
|
error('MESON_SKIP_TEST: unsupported cpu family: ' + cpu)
|
||
|
endif
|
||
|
|
||
|
if cc.symbols_have_underscore_prefix()
|
||
|
add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'c')
|
||
|
endif
|
||
|
|
||
8 years ago
|
copy = find_program('copyfile.py')
|
||
8 years ago
|
output = 'square-@0@.S'.format(cpu)
|
||
|
input = output + '.in'
|
||
|
|
||
|
copygen = generator(copy,
|
||
|
arguments : ['@INPUT@', '@OUTPUT@'],
|
||
|
output : '@BASENAME@')
|
||
|
|
||
|
l = shared_library('square-gen', copygen.process(input))
|
||
|
|
||
|
test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l))
|
||
|
|
||
|
copyct = custom_target('square',
|
||
|
input : input,
|
||
|
output : output,
|
||
|
command : [copy, '@INPUT@', '@OUTPUT@'])
|
||
|
|
||
|
l = shared_library('square-ct', copyct)
|
||
|
|
||
|
test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l))
|