Add gtk-doc as a subproject
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 28 Jan 2020 15:50:53 +0000 (16:50 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 29 Jan 2020 08:39:21 +0000 (09:39 +0100)
We rely on a specific minimum version of gtk-doc to be able to build the
GTK API reference for the new API. In order to be able to use gtk-doc as
a subproject, though, we need to use a recent version of Meson.

docs/reference/meson.build
subprojects/gtk-doc.wrap [new file with mode: 0644]

index a308cc4c87e3d9e3ff8fd82102c7ff5bddee5d5a..842d3a68d92f6e0c3402872524fc0cfe4cf16690 100644 (file)
@@ -1,4 +1,13 @@
 if get_option('gtk_doc')
+  if not meson.version().version_compare('>=0.52.0')
+    error('Building the GTK documentation requires Meson 0.52.0')
+  endif
+
+  # Use gtk-doc as a sub-project if the version isn't new enough
+  dependency('gtk-doc', version: '>=1.32',
+    fallback: ['gtk-doc', 'dummy_dep'],
+    default_options: ['tests=false'])
+
   glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
   glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
 
diff --git a/subprojects/gtk-doc.wrap b/subprojects/gtk-doc.wrap
new file mode 100644 (file)
index 0000000..7469d02
--- /dev/null
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=gtk-doc
+url=https://gitlab.gnome.org/GNOME/gtk-doc.git
+revision=master