summaryrefslogtreecommitdiff
path: root/docs/meson.build
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2018-10-22 11:48:29 +0200
committerThibault Saunier <tsaunier@igalia.com>2019-05-13 17:00:00 -0400
commitb0f5a5976046f34a2f829d55abecf58b675d8261 (patch)
tree10a6fb22bc7c06749a559d86252411697f977d36 /docs/meson.build
parent0af3e36068a93a68ec6c3c039f28c441bf0af26a (diff)
docs: Port to hotdoc
Diffstat (limited to 'docs/meson.build')
-rw-r--r--docs/meson.build62
1 files changed, 62 insertions, 0 deletions
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 00000000..8eca23c9
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,62 @@
+build_hotdoc = false
+
+if meson.is_cross_build()
+ if get_option('doc').enabled()
+ error('Documentation enabled but building the doc while cross building is not supported yet.')
+ endif
+
+ message('Documentation not built as building it while cross building is not supported yet.')
+ subdir_done()
+endif
+
+required_hotdoc_extensions = ['gi-extension', 'gst-extension']
+if gst_dep.type_name() == 'internal'
+ gst_proj = subproject('gstreamer')
+ plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
+else
+ plugins_cache_generator = find_program(join_paths(gst_dep.get_pkg_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+ required: false)
+endif
+
+plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
+if plugins_cache_generator.found()
+ plugins_doc_dep = custom_target('vaapi-plugins-doc-cache',
+ command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
+ input: plugins,
+ output: 'gst_plugins_cache.json',
+ )
+else
+ warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
+endif
+
+hotdoc_p = find_program('hotdoc', required: get_option('doc'))
+if not hotdoc_p.found()
+ message('Hotdoc not found, not building the documentation')
+ subdir_done()
+endif
+
+build_hotdoc = true
+hotdoc = import('hotdoc')
+if not hotdoc.has_extensions(required_hotdoc_extensions)
+ if get_option('doc').enabled()
+ error('Documentation enabled but gi-extension missing')
+ endif
+
+ message('@0@ extensions not found, not building documentation'.format(required_hotdoc_extensions))
+ subdir_done()
+endif
+
+message('Plugins: @0@'.format(plugins))
+libs_doc = []
+plugins_doc = [hotdoc.generate_doc('vaapi',
+ project_version: api_version,
+ sitemap: 'sitemap.txt',
+ index: 'index.md',
+ gst_index: 'index.md',
+ gst_smart_index: true,
+ gst_c_sources: ['../gst/*/*.[ch]',],
+ gst_cache_file: plugins_cache,
+ gst_plugin_name: 'vaapi',
+ dependencies: [gstbase_dep, gstvideo_dep, gstallocators_dep, gstpbutils_dep,
+ libva_dep, gstlibvaapi_dep, gstgl_dep, libm] + plugins,
+)]