summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-07-19 15:53:37 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-07-19 15:53:37 +0530
commit057f393bbb586482c808d964869e613f5702539e (patch)
treee98e624751af0a780eff8fd1046f6a58b7a8466c
parented6a29a5b96da05b8c776b04dd8ffa2391139afd (diff)
downloadglib-nirbheek/override-find-program.tar.gz
meson: Provide our Python tools for buildsnirbheek/override-find-program
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.
-rw-r--r--gio/gdbus-2.0/codegen/meson.build2
-rw-r--r--gobject/meson.build2
2 files changed, 4 insertions, 0 deletions
diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
index af1bc9fb2..3ac6ea508 100644
--- a/gio/gdbus-2.0/codegen/meson.build
+++ b/gio/gdbus-2.0/codegen/meson.build
@@ -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')
diff --git a/gobject/meson.build b/gobject/meson.build
index d34a897a7..01ba59b70 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -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',