[gtk/building-docs: 1/4] docs: Add a section on supported build types



commit 56b38ef15c5512f39a75166ad80563b37fba4ee4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 1 16:19:12 2019 +0100

    docs: Add a section on supported build types
    
    GTK uses the Meson `buildtype` option to determine whether to enable or
    disable debugging code and safeties. We should document our behaviour
    and expectations.

 docs/reference/gtk/building.sgml | 53 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
---
diff --git a/docs/reference/gtk/building.sgml b/docs/reference/gtk/building.sgml
index 86d059fe90..027fe023a0 100644
--- a/docs/reference/gtk/building.sgml
+++ b/docs/reference/gtk/building.sgml
@@ -106,6 +106,59 @@ How to compile GTK itself
       export LD_LIBRARY_PATH PATH
     </programlisting>
   </refsect1>
+
+  <refsect1 id="build-types">
+    <title>Build types</title>
+
+    <para>Meson has different build types, exposed by the <literal>buildtype</literal>
+    configuration option. GTK enables and disables functionality depending on
+    the build type used when calling <application>meson</application> to
+    configure the build.</para>
+
+    <formalpara>
+      <title><systemitem>debug</systemitem> and <systemitem>debugoptimized</systemitem></title>
+
+      <para>
+        GTK will enable debugging code paths in both the
+        <literal>debug</literal> and <literal>debugoptimized</literal>
+        build types. Builds with <literal>buildtype</literal> set
+        to <literal>debug</literal> will additionally enable
+        consistency checks on the internal state of the toolkit.
+      </para>
+
+      <para>
+        It is recommended to use the <literal>debug</literal> or
+        <literal>debugoptimized</literal> build types when developing
+        GTK itself.
+      </para>
+
+      <para>
+        The <literal>debugoptimized</literal> build type is the
+        default for GTK if no build type is specified when calling
+        <application>meson</application>
+      </para>
+    </formalpara>
+
+    <formalpara>
+      <title><systemitem>release</systemitem></title>
+
+      <para>
+        The <literal>release</literal> build type will disable
+        debugging code paths and additional run time safeties, like
+        checked casts for object instances.
+      </para>
+    </formalpara>
+
+    <para>
+      The <literal>plain</literal> build type provided by Meson
+      should only be used when packaging GTK, and it's expected
+      that packagers will provide their own compiler flags when
+      building GTK. See the previous section for the list of
+      environment variables to be used to define compiler and
+      linker flags.
+    </para>
+  </refsect1>
+
   <refsect1 id="dependencies">
     <title>Dependencies</title>
     <para>


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