meson: Provide our Python tools for builds

Several of our tools are installed and are used by other projects to
generate code. However, there is no 'install' when projects use glib
as a subproject.

We need some way for glib to 'provide' these tools so that when some
project uses glib as a subproject, find_program('glib-mkenums') will
transparently return the glib-mkenums we just built.

Starting from Meson 0.46, this can be done with the
`meson.override_find_program()` function.

As a bonus, the Meson GNOME module will also use these
'overriden'/'provided' programs instead of looking for them in PATH.
This commit is contained in:
Nirbheek Chauhan 2018-07-19 15:53:37 +05:30
parent ed6a29a5b9
commit 057f393bbb
2 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,8 @@ gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
install_dir : get_option('bindir'),
configuration : gdbus_codegen_conf
)
# Provide tools for others when we're a subproject and they use the Meson GNOME module
meson.override_find_program('gdbus-codegen', gdbus_codegen)
codegen_dir = join_paths(get_option('datadir'), 'glib-2.0/codegen')

View File

@ -105,6 +105,8 @@ foreach tool: python_tools
# Set variables for later use
set_variable(tool.underscorify(), tool_bin)
# Provide tools for others when we're a subproject and they use the Meson GNOME module
meson.override_find_program(tool, tool_bin)
endforeach
executable('gobject-query', 'gobject-query.c',