@@ -318,6 +318,7 @@ foo_h = foo_lib.vala_header()
318318This header can now be used like any other generated header to create an
319319order-only dependency.
320320
321+
321322# ## Depending on VAPI header
322323
323324*(since 1.10.0)*
@@ -329,6 +330,15 @@ foo_lib = shared_library(...)
329330foo_vapi = foo_lib.vala_vapi()
330331` ` `
331332
333+ # ## Depending on generated GIR
334+
335+ *(since 1.10.0)*
336+
337+ ` ` ` meson
338+ foo_lib = shared_library(..., vala_gir : 'foo.gir')
339+ foo_gir = foo_lib.vala_gir()
340+ ` ` `
341+
332342# ## GObject Introspection and language bindings
333343
334344A 'binding' allows another programming language to use a library
@@ -363,6 +373,21 @@ directory (i.e. `share/gir-1.0` for GIRs). The fourth element in the
363373To then generate a typelib file use a custom target with the
364374`g-ir-compiler` program and a dependency on the library :
365375
376+ Since Meson 1.10, use the `.vala_gir()` method to get a handle to the generated `.gir` file :
377+
378+ ` ` ` meson
379+ g_ir_compiler = find_program('g-ir-compiler')
380+ custom_target('foo typelib', command: [g_ir_compiler, '--output', '@OUTPUT@', '@INPUT@'],
381+ input: foo_lib.vala_gir(),
382+ output: 'Foo-1.0.typelib',
383+ install: true,
384+ install_dir: get_option('libdir') / 'girepository-1.0')
385+ ` ` `
386+
387+
388+ For older versions, calculating the path to the input is required, as is adding a
389+ manual dependency to the vala target :
390+
366391` ` ` meson
367392g_ir_compiler = find_program('g-ir-compiler')
368393custom_target('foo typelib', command: [g_ir_compiler, '--output', '@OUTPUT@', '@INPUT@'],
0 commit comments