[gimp/wip/Jehan/meson-windows-official: 12/14] configure, libgimp: disable GIR build when cross-compiling and…




commit 870947aca9a1b9c6f27836931c427f4c87deaf0b
Author: Jehan <jehan girinstud io>
Date:   Thu Mar 31 15:44:52 2022 +0200

    configure, libgimp: disable GIR build when cross-compiling and…
    
    … add --enable-force-gir-cross-compilation to force it anyway.
    
    Similar to what we already have in the meson build.

 configure.ac        | 30 ++++++++++++++++++++++++++++--
 libgimp/Makefile.am |  3 +++
 2 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1b9e23b3b7..0fea088ad0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2299,7 +2299,33 @@ AM_CONDITIONAL(WITH_PDBGEN, test "x$with_pdbgen" = xyes)
 # Check for GObject Introspection
 #################################
 
-GOBJECT_INTROSPECTION_REQUIRE(introspection_required_version)
+AC_ARG_ENABLE(force-gir-cross-compilation,
+              [  --enable-force-gir-cross-compilation
+                          GIR is buildable even if cross-compiling
+                          (default=auto)],,
+              enable_force_gir_cross_compilation=auto)
+
+AC_MSG_CHECKING([if introspecting libgimp])
+warning_gir=
+build_gir=yes
+if test "x$cross_compiling" != xyes ||
+   test "x$enable_force_gir_cross_compilation" = xyes; then
+  # When not-cross-compiling, we always build with introspection.
+  # It's the basic case.
+  GOBJECT_INTROSPECTION_REQUIRE(introspection_required_version)
+else
+  build_gir=no
+  warning_gir="
+WARNING: GObject Introspection is disabled while cross-compiling because
+         GI tools do not manage to properly generate introspection data
+         while cross-compiling. Nevertheless we consider our introspected
+         API as a core component of GIMP, thus you are expected to build
+         this data natively.
+         To forcefully build with GObject Introspection, set:
+         --enable-force-gir-cross-compilation"
+fi
+AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$build_gir" != xno)
+AC_MSG_RESULT([$build_gir])
 
 #####################
 # Check for json-glib
@@ -3300,7 +3326,7 @@ Documentation:
   GObject Introspection:     $enable_g_ir_doc
 
 Bug report URL: $with_bug_report_url
-$override_bug_report_url$warning_vector_icons_windows$warning_glib_networking$warning_gcc$warning_python$warning_javascript$warning_lua$warning_libheif$warning_libmypaint"
+$override_bug_report_url$warning_vector_icons_windows$warning_glib_networking$warning_gcc$warning_python$warning_javascript$warning_lua$warning_libheif$warning_libmypaint$warning_gir"
 
 if test "x$required_deps" = "x"; then
   AC_OUTPUT
diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am
index db6c042767..a216ae8fa5 100644
--- a/libgimp/Makefile.am
+++ b/libgimp/Makefile.am
@@ -246,6 +246,8 @@ gimpuimarshal.c: gimpuimarshal.h
 
 ### GObject introspection
 
+if HAVE_INTROSPECTION
+
 -include $(INTROSPECTION_MAKEFILE)
 include ../libgimpbase/Makefile.gi
 include ../libgimpcolor/Makefile.gi
@@ -463,3 +465,4 @@ EXTRA_DIST += \
        GimpUi-@GIMP_API_VERSION@.metadata
 
 endif # ENABLE_VAPIGEN
+endif # HAVE_INTROSPECTION


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