Meson: Override glib-compile-resources/schemas

This fix build error for projects that use gnome.compile_resources()
when glib is built as a subproject and not installed on the build
machine.

Note that this is not working for cross compilation cases, because it
would require to compile everything twice (for host and build machines).
A better solution would be to rewrite those tools in python. See #1859.
This commit is contained in:
Xavier Claessens 2019-08-13 08:44:45 -04:00
parent 09b3bf21c9
commit fdcdd5c5b4

View File

@ -963,6 +963,14 @@ glib_compile_resources = executable('glib-compile-resources',
link_args : noseh_link_args,
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
# Cannot override those programs in cross compilation case because they are
# native executables that cannot be run on the build machine.
# See https://gitlab.gnome.org/GNOME/glib/issues/1859.
if not meson.is_cross_build()
meson.override_find_program('glib-compile-schemas', glib_compile_schemas)
meson.override_find_program('glib-compile-resources', glib_compile_resources)
endif
executable('gsettings', 'gsettings-tool.c',
install : true,
c_args : gio_c_args,