[vala/0.48] tests: Build typelib if g-ir-compiler is available



commit 7892cf33fafa9487703b39bb181061c008a1da9b
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Jun 11 13:29:52 2020 +0200

    tests: Build typelib if g-ir-compiler is available

 configure.ac                | 3 +++
 tests/girwriter/Makefile.am | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3bc6e7a42..8a4dee8b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -205,6 +205,9 @@ fi
 AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
 AM_CONDITIONAL(ENABLE_VALADOC, test x$enable_valadoc = xyes)
 
+AC_PATH_PROG([G_IR_COMPILER], [g-ir-compiler], :)
+AM_CONDITIONAL(HAVE_G_IR_COMPILER, test "$G_IR_COMPILER" != :)
+
 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
 
diff --git a/tests/girwriter/Makefile.am b/tests/girwriter/Makefile.am
index f5770e9cd..d5c383178 100644
--- a/tests/girwriter/Makefile.am
+++ b/tests/girwriter/Makefile.am
@@ -11,8 +11,11 @@ check-girwriter: $(top_builddir)/compiler/valac
                --shared-library girtest \
                $(srcdir)/girtest.vala; \
        tail -n +3 girtest.vapi | diff -wu $(srcdir)/girtest.vapi-expected - || exit 1; \
-       tail -n +3 GirTest-1.0.gir | diff -wu $(srcdir)/GirTest-1.0.gir-expected - || exit 1; \
-       rm -f GirTest-1.0.gir girtest.vapi girtest.c
+       tail -n +3 GirTest-1.0.gir | diff -wu $(srcdir)/GirTest-1.0.gir-expected - || exit 1;
+if HAVE_G_IR_COMPILER
+       $(G_IR_COMPILER) -o GirTest-1.0.typelib GirTest-1.0.gir;
+endif
+       rm -f GirTest-1.0.gir GirTest-1.0.typelib girtest.vapi girtest.c
 
 check: check-girwriter
 
@@ -26,4 +29,5 @@ CLEANFILES = \
        girtest.c \
        girtest.vapi \
        GirTest-1.0.gir \
+       GirTest-1.0.typelib \
        $(NULL)


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