[glib: 1/2] Meson: Override glib-compile-resources/schemas



commit fdcdd5c5b43a9673d71df18255fcb11aaa4df762
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Tue Aug 13 08:44:45 2019 -0400

    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.

 gio/meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gio/meson.build b/gio/meson.build
index 987d0f4c6..c0e0e81f8 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]