diff options
Diffstat (limited to 'meson/test cases/common/52 object generator/meson.build')
-rw-r--r-- | meson/test cases/common/52 object generator/meson.build | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meson/test cases/common/52 object generator/meson.build b/meson/test cases/common/52 object generator/meson.build new file mode 100644 index 000000000..e20da6f46 --- /dev/null +++ b/meson/test cases/common/52 object generator/meson.build @@ -0,0 +1,34 @@ +project('object generator', 'c') + +python = find_program('python3', required : false) +if not python.found() + python = find_program('python') +endif + +# 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') + +if host_machine.system() == 'windows' + outputname = '@BASENAME@.obj' +else + outputname = '@BASENAME@.o' +endif + +cc = meson.get_compiler('c').cmd_array().get(-1) +# Generate an object file manually. +gen = generator(python, + output : outputname, + arguments : [comp, cc, '@INPUT@', '@OUTPUT@']) + +generated = gen.process(['source.c', 'source2.c']) + +# 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) + +test('objgen', e)
\ No newline at end of file |