2018-10-22 09:39:55 +00:00
|
|
|
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
|
|
|
|
|
2021-10-12 18:52:48 +00:00
|
|
|
required_hotdoc_extensions = ['gst-extension']
|
2018-10-22 09:39:55 +00:00
|
|
|
if gst_dep.type_name() == 'internal'
|
|
|
|
gst_proj = subproject('gstreamer')
|
|
|
|
plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
|
|
|
|
else
|
2021-10-17 23:40:14 +00:00
|
|
|
plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
|
2018-10-22 09:39:55 +00:00
|
|
|
required: false)
|
|
|
|
endif
|
|
|
|
|
|
|
|
plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
|
2019-07-17 13:42:19 +00:00
|
|
|
if plugins.length() == 0
|
|
|
|
message('All good plugins have been disabled')
|
|
|
|
elif plugins_cache_generator.found()
|
2018-10-22 09:39:55 +00:00
|
|
|
plugins_doc_dep = custom_target('good-plugins-doc-cache',
|
|
|
|
command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
|
|
|
|
input: plugins,
|
|
|
|
output: 'gst_plugins_cache.json',
|
2020-06-22 22:02:21 +00:00
|
|
|
build_always_stale: true,
|
2018-10-22 09:39:55 +00:00
|
|
|
)
|
|
|
|
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
|
|
|
|
|
2020-06-03 22:35:58 +00:00
|
|
|
hotdoc_req = '>= 0.11.0'
|
2022-01-04 20:37:59 +00:00
|
|
|
hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
|
2020-06-03 22:35:58 +00:00
|
|
|
if not hotdoc_version.version_compare(hotdoc_req)
|
|
|
|
if get_option('doc').enabled()
|
|
|
|
error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
|
|
|
|
else
|
|
|
|
message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-10-22 09:39:55 +00:00
|
|
|
hotdoc = import('hotdoc')
|
|
|
|
foreach extension: required_hotdoc_extensions
|
|
|
|
if not hotdoc.has_extensions(extension)
|
|
|
|
if get_option('doc').enabled()
|
|
|
|
error('Documentation enabled but @0@ missing'.format(extension))
|
|
|
|
endif
|
|
|
|
|
|
|
|
message('@0@ extension not found, not building documentation'.format(extension))
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
docconf = configuration_data()
|
|
|
|
docconf.set('GST_API_VERSION', api_version)
|
|
|
|
configure_file(input : 'gst_api_version.in',
|
|
|
|
output : 'gst_api_version.md',
|
|
|
|
configuration : docconf)
|
|
|
|
libs_doc = []
|
|
|
|
plugins_doc = []
|
|
|
|
excludes = []
|
|
|
|
build_hotdoc = true
|
|
|
|
foreach f: ['gstgdkpixbufplugin.c']
|
|
|
|
excludes += [join_paths(meson.current_source_dir(), '..', 'ext/gdk_pixbuf/', f)]
|
|
|
|
endforeach
|
|
|
|
|
2020-07-09 19:08:34 +00:00
|
|
|
excludes += [join_paths(meson.current_source_dir(), '..', 'sys', 'rpicamsrc', 'Raspi*.[ch]')]
|
|
|
|
|
2018-10-22 09:39:55 +00:00
|
|
|
list_plugin_res = run_command(python3, '-c',
|
|
|
|
'''
|
|
|
|
import sys
|
|
|
|
import json
|
|
|
|
|
|
|
|
with open("@0@") as f:
|
|
|
|
print(':'.join(json.load(f).keys()), end='')
|
2022-01-04 20:37:59 +00:00
|
|
|
'''.format(plugins_cache),
|
|
|
|
check: true)
|
2018-10-22 09:39:55 +00:00
|
|
|
foreach plugin_name: list_plugin_res.stdout().split(':')
|
|
|
|
plugins_doc += [hotdoc.generate_doc(plugin_name,
|
|
|
|
project_version: api_version,
|
|
|
|
sitemap: 'sitemap.txt',
|
|
|
|
index: 'index.md',
|
|
|
|
gst_index: 'index.md',
|
|
|
|
gst_smart_index: true,
|
2022-01-31 23:37:04 +00:00
|
|
|
gst_c_sources: [
|
|
|
|
'../sys/*/*.[cmh]',
|
|
|
|
'../ext/*/*.[ch]',
|
2022-03-11 16:11:50 +00:00
|
|
|
'../ext/*/*/*.[ch]',
|
2022-01-31 23:37:04 +00:00
|
|
|
'../gst/*/*.[ch]',
|
|
|
|
],
|
2018-10-22 09:39:55 +00:00
|
|
|
gst_c_source_filters: excludes,
|
|
|
|
dependencies: [gst_dep, plugins],
|
|
|
|
gst_order_generated_subpages: true,
|
|
|
|
install: false,
|
|
|
|
disable_incremental_build: true,
|
|
|
|
gst_cache_file: plugins_cache,
|
|
|
|
gst_plugin_name: plugin_name,
|
2019-05-29 20:06:58 +00:00
|
|
|
include_paths: join_paths(meson.current_source_dir(), '..'),
|
2018-10-22 09:39:55 +00:00
|
|
|
)]
|
2019-05-16 13:14:19 +00:00
|
|
|
endforeach
|