3 if meson.is_cross_build()
4 if get_option('doc').enabled()
5 error('Documentation enabled but building the doc while cross building is not supported yet.')
8 message('Documentation not built as building it while cross building is not supported yet.')
12 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
13 if gst_dep.type_name() == 'internal'
14 gst_proj = subproject('gstreamer')
15 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
17 plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + apiversion, 'gst-plugins-doc-cache-generator'), required: false)
20 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
22 if plugins_cache_generator.found()
23 plugins_doc_dep = custom_target('editing-services-doc-cache',
24 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
26 output: 'gst_plugins_cache.json',
27 build_always_stale: true,
30 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
33 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
34 if not hotdoc_p.found()
35 message('Hotdoc not found, not building the documentation')
39 hotdoc_req = '>= 0.11.0'
40 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
41 if not hotdoc_version.version_compare(hotdoc_req)
42 if get_option('doc').enabled()
43 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
45 message('Hotdoc version @0@ not found, got @1@, not building documentation'.format(hotdoc_req, hotdoc_version))
50 hotdoc = import('hotdoc')
51 foreach extension: required_hotdoc_extensions
52 if not hotdoc.has_extensions(extension)
53 if get_option('doc').enabled()
54 error('Documentation enabled but gi-extension missing')
57 message('@0@ extensions not found, not building documentation requiring it'.format(extension))
62 if get_option('doc').enabled()
63 error('Documentation enabled but introspection not built.')
66 message('Introspection not built, can\'t build the documentation')
72 foreach f: ['gesmarshal.*',
74 'ges-auto-transition.*',
75 'ges-structured-interface.*',
76 'ges-structure-parser.*',
79 'ges-command-line-formatter.*',
80 'ges-base-xml-formatter.h',
81 'gstframepositioner.*',
82 'lex.priv_ges_parse_yy.c',
84 ges_excludes += [join_paths(meson.current_source_dir(), '..', '..', 'ges', f)]
87 hotdoc = import('hotdoc')
88 libs_doc = [hotdoc.generate_doc('gst-editing-services',
89 project_version: apiversion,
90 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
91 gi_c_sources: ges_sources + ges_headers,
92 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../ges/')],
93 gi_sources: [ges_gir[0].full_path()],
94 gi_c_source_filters: ges_excludes,
95 sitemap: 'sitemap.txt',
99 gi_order_generated_subpages: true,
100 dependencies: [ges_dep],
101 disable_incremental_build: true,
105 list_plugin_res = run_command(python3, '-c',
110 with open("@0@") as f:
111 print(':'.join(json.load(f).keys()), end='')
112 '''.format(plugins_cache))
114 assert(list_plugin_res.returncode() == 0,
115 'Could not list plugins from @0@\n@1@\n@1@'.format(plugins_cache, list_plugin_res.stdout(), list_plugin_res.stderr()))
118 foreach plugin_name: list_plugin_res.stdout().split(':')
119 plugins_doc += [hotdoc.generate_doc(plugin_name,
120 project_version: apiversion,
121 sitemap: 'plugins/sitemap.txt',
122 index: 'plugins/index.md',
123 gst_index: 'plugins/index.md',
124 gst_smart_index: true,
125 gst_c_sources: ['../plugins/*/*.[ch]',],
126 dependencies: [gst_dep, plugins],
127 gst_order_generated_subpages: true,
128 gst_cache_file: plugins_cache,
129 gst_plugin_name: plugin_name,