Open
Description
Meson adds the dependency for building Vala-based targets to the .c → .o target, but some dependencies are needed at the .vala → .c target — for instance, a dependency on an in-tree GIR file needs to be satisfied when building the C source from Vala.
If I generate introspection data with gnome.generate_gir()
and then declare a dependency:
totem_gir = gnome.generate_gir(...)
totem_gir_dep = declare_dependency(sources: totem_gir[0])
And then use the totem_gir_dep
as a dependency for a build target like:
shared_module('some vala plugin', sources: 'foo.vala', dependencies: totem_gir_dep, ...)
Then Meson will generate a build target like:
build src/plugins/rotation/rotation@sha/totem-rotation-plugin.c src/plugins/rotation/rotation.h src/plugins/rotation/rotation.vapi: vala_COMPILER ../src/plugins/rotation/bacon-video.vapi ../src/plugins/rotation/totem-rotation-plugin.vala
...
build src/plugins/rotation/rotation@sha/src_plugins_rotation_rotation@sha_totem-rotation-plugin.c.o: c_COMPILER src/plugins/rotation/rotation@sha/totem-rotation-plugin.c || src/Totem-1.0.gir
With the src/Totem-1.0.gir
dependency on the latter rule, instead of the former.