[glib/issue-1783: 1271/1273] Add example of using glib-genmarshal with Meson



commit 9d7988f37f9dd23687982e61cdb28363fe34fab6
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue May 21 18:21:03 2019 +0100

    Add example of using glib-genmarshal with Meson
    
    We're using Meson for GLib itself, and we recommend people to use it
    for their own projects, so it would be good to have our documentation
    present examples on how to use Meson with our tools.

 docs/reference/gobject/glib-genmarshal.xml | 41 +++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gobject/glib-genmarshal.xml b/docs/reference/gobject/glib-genmarshal.xml
index bf72ba7fe..254a9a64d 100644
--- a/docs/reference/gobject/glib-genmarshal.xml
+++ b/docs/reference/gobject/glib-genmarshal.xml
@@ -411,7 +411,46 @@ debugging information. This option is mutually exclusive with the
 </variablelist>
 </refsect1>
 
-<refsect1><title>Using glib-genmarshal with Autotools</title>
+<refsect1><title>Using <command>glib-genmarshal</command> with Meson<title>
+<para>
+Meson supports generating closure marshallers using <command>glib-genmarshal</command>
+out of the box in its "gnome" module.
+</para>
+
+<para>
+In your <filename>meson.build</filename> file you will typically call the
+<literal>gnome.genmarshal()</literal> method with the source list of marshallers
+to generate:
+</para>
+<informalexample><programlisting>
+gnome = import('gnome')
+marshal_files = gnome.genmarshal('marshal',
+  sources: 'marshal.list',
+  internal: true,
+)
+</programlisting></informalexample>
+<para>
+The <literal>marshal_files</literal> variable will contain an array of two elements
+in the following order:
+</para>
+<itemizedlist>
+  <listitem><para>a build target for the source file</para></listitem>
+  <listitem><para>a build target for the header file</para></listitem>
+</itemizedlist>
+<para>
+You should use the returned objects to provide a dependency on every other
+build target that references the source or header file; for instance, if you
+are using the source to build a library:
+</para>
+<informalexample><programlisting>
+mainlib = library('project',
+  sources: project_sources + marshal_files,
+  ...
+)
+</programlisting></informalexample>
+</refsect1>
+
+<refsect1><title>Using <command>glib-genmarshal</command> with Autotools</title>
 <para>
 In order to use <command>glib-genmarshal</command> in your project when using
 Autotools as the build system, you will first need to modify your


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