[Spice-devel] [PATCH spice-gtk 25/34] meson: add gtk_doc option

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Mon Jan 7 08:00:54 UTC 2019


From: Marc-André Lureau <marcandre.lureau at redhat.com>

This is based on similar meson code in GStreamer.
(one of the core meson developer, Nirbheek, is also doing the GStreamer
meson build support)

This allows me to install a meson-mingw64 build, with
-Dgtk_doc=disabled, as it fails to build currently for other reasons
which I don't have time to investigate yet.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 meson.build       | 10 +++++++++-
 meson_options.txt |  4 ++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index cb37056..b596a0f 100644
--- a/meson.build
+++ b/meson.build
@@ -326,7 +326,15 @@ add_project_arguments(compiler.get_supported_arguments(spice_gtk_global_cflags),
 subdir('src')
 subdir('tools')
 subdir('tests')
-subdir('doc')
+if build_machine.system() == 'windows'
+  message('Disabling gtk-doc while building on Windows')
+else
+  if find_program('gtkdoc-scan', required : get_option('gtk_doc')).found()
+    subdir('doc')
+  else
+    message('Not building documentation as gtk-doc was not found')
+  endif
+endif
 subdir('data')
 subdir('man')
 subdir('po')
diff --git a/meson_options.txt b/meson_options.txt
index 8dcded2..ff4654d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -76,3 +76,7 @@ option('opus',
 option('smartcard',
     type : 'feature',
     description : 'Enable smartcard support')
+
+option('gtk_doc',
+       type : 'feature',
+       description : 'Generate API documentation with gtk-doc')
-- 
2.20.1.2.gb21ebb671b



More information about the Spice-devel mailing list