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.
34 lines
949 B
34 lines
949 B
11 years ago
|
project('object generator', 'c')
|
||
|
|
||
8 years ago
|
python = find_program('python3', required : false)
|
||
|
if not python.found()
|
||
|
python = find_program('python')
|
||
|
endif
|
||
11 years ago
|
|
||
|
# Note that this will not add a dependency to the compiler executable.
|
||
|
# Code will not be rebuilt if it changes.
|
||
|
comp = '@0@/@1@'.format(meson.current_source_dir(), 'obj_generator.py')
|
||
|
|
||
9 years ago
|
if host_machine.system() == 'windows'
|
||
11 years ago
|
outputname = '@BASENAME@.obj'
|
||
|
else
|
||
|
outputname = '@BASENAME@.o'
|
||
|
endif
|
||
|
|
||
10 years ago
|
cc = meson.get_compiler('c').cmd_array().get(-1)
|
||
10 years ago
|
# Generate an object file manually.
|
||
11 years ago
|
gen = generator(python,
|
||
11 years ago
|
output : outputname,
|
||
10 years ago
|
arguments : [comp, cc, '@INPUT@', '@OUTPUT@'])
|
||
11 years ago
|
|
||
9 years ago
|
generated = gen.process(['source.c', 'source2.c'])
|
||
11 years ago
|
|
||
9 years ago
|
# Generate an object file with indexed OUTPUT replacement.
|
||
|
gen2 = generator(python,
|
||
|
output : outputname,
|
||
|
arguments : [comp, cc, '@INPUT@', '@OUTPUT0@'])
|
||
|
generated2 = gen2.process(['source3.c'])
|
||
|
|
||
|
e = executable('prog', 'prog.c', generated, generated2)
|
||
11 years ago
|
|
||
|
test('objgen', e)
|