Open kusma opened 2 years ago
Worth noting: This seems to work if the second generator is replaced with custom_target()
instead:
project('bug-repro', 'c')
gen_foo = generator(
find_program('cat'),
output : '@BASENAME@.foo',
arguments : ['@INPUT@'],
capture : true
)
input_foo = gen_foo.process('input.txt')
input_bar = custom_target('input.bar',
input: input_foo,
output: 'input.bar',
command : [find_program('cat'), '@INPUT@'],
capture : true
)
executable(
'dummy', [files('main.c'), input_bar],
)
Just to give some more background on what I'm trying to do:
I'm trying to implement baking of binary data to be embedded into an executable using Meson. This involves processing some graphics files (tiling of images, dumping of bitmap data etc) as well as some bin2c kind of magic at the end to create something that can be compiled out of the result.
However, these baking tasks are fairly repetitive, so generators makes it a lot more manageable to maintain. Sadly, that doesn't seem to work.
This is still an issue with meson 1.1.1 and 1.2.0. In the latter two cases, such a chaining just results in a build time Ninja error:
ninja: error: 'libavfilter/vf_yadif_videotoolbox.metal.metallib', needed by 'libavfilter-static.a.p/vf_yadif_videotoolbox.metal.metallib.c', missing and no known rule to make it
Files are generated e.g.
gen_objects = libavfilter_optional_sources['yadif_videotoolbox_filter']
gen_objects += bin2c.process(metallib.process(metalcc.process(
files('metal/vf_yadif_videotoolbox.metal',)
)))
libavfilter_optional_sources += {
'yadif_videotoolbox_filter' : gen_objects,
}
Describe the bug When passing the output of
generator().process()
togenerator().process()
, an assertion triggers in Meson.To Reproduce
meson.build
You also need to create a input.txt and main.c file. The content of these doesn't matter, as Meson crashes before they are even processed.
When running
meson <build-dir>
, I get this crash:Expected behavior Meson should finish configure, and let us at least try to compile the result.
system parameters