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.
45 lines
1.1 KiB
45 lines
1.1 KiB
7 years ago
|
project('nasm config file', 'c')
|
||
|
|
||
|
if host_machine.cpu_family() == 'x86' and host_machine.system() == 'windows'
|
||
|
asm_format = 'win32'
|
||
|
elif host_machine.cpu_family() == 'x86_64' and host_machine.system() == 'windows'
|
||
|
asm_format = 'win64'
|
||
|
elif host_machine.cpu_family() == 'x86' and host_machine.system() == 'linux'
|
||
|
asm_format = 'elf32'
|
||
|
elif host_machine.cpu_family() == 'x86_64' and host_machine.system() == 'linux'
|
||
|
asm_format = 'elf64'
|
||
|
else
|
||
|
error('MESON_SKIP_TEST: skipping test on this platform')
|
||
|
endif
|
||
|
|
||
|
nasm = find_program('nasm', required: false)
|
||
|
|
||
|
if not nasm.found()
|
||
|
error('MESON_SKIP_TEST: nasm not available')
|
||
|
endif
|
||
|
|
||
|
conf = configuration_data()
|
||
|
|
||
|
conf.set('HELLO', 0)
|
||
|
|
||
|
asm_gen = generator(nasm,
|
||
|
output : '@BASENAME@.o',
|
||
|
arguments : [
|
||
|
'-f', asm_format,
|
||
|
'-i', meson.current_source_dir() + '/',
|
||
|
'-i', join_paths(meson.current_source_dir(), ''),
|
||
|
'-P', join_paths(meson.current_build_dir(), 'config.asm'),
|
||
|
'@INPUT@',
|
||
|
'-o', '@OUTPUT@'])
|
||
|
|
||
|
|
||
|
config_file = configure_file(
|
||
|
output: 'config.asm',
|
||
|
configuration: conf,
|
||
|
output_format: 'nasm',
|
||
|
)
|
||
|
|
||
|
exe = executable('hello', asm_gen.process('hello.asm'))
|
||
|
|
||
|
test('test-nasm-configure-file', exe)
|