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.')
13 if get_option('doc').enabled()
14 error('Documentation enabled but not supported when building statically.')
17 message('Building statically, can\'t build the documentation')
22 if get_option('doc').enabled()
23 error('Documentation enabled but introspection not built.')
26 message('Introspection not built, won\'t build documentation requiring it')
30 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
31 if gst_dep.type_name() == 'internal'
32 gst_proj = subproject('gstreamer')
33 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
35 plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + apiversion, 'gst-plugins-doc-cache-generator'), required: false)
38 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
40 if plugins_cache_generator.found()
41 gst_plugins_doc_dep = custom_target('editing-services-doc-cache',
42 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
44 output: 'gst_plugins_cache.json',
45 build_always_stale: true,
48 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
51 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
52 if not hotdoc_p.found()
53 message('Hotdoc not found, not building the documentation')
57 hotdoc_req = '>= 0.11.0'
58 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
59 if not hotdoc_version.version_compare(hotdoc_req)
60 if get_option('doc').enabled()
61 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
63 message('Hotdoc version @0@ not found, got @1@, not building documentation'.format(hotdoc_req, hotdoc_version))
68 hotdoc = import('hotdoc')
69 foreach extension: required_hotdoc_extensions
70 if not hotdoc.has_extensions(extension)
71 if get_option('doc').enabled()
72 error('Documentation enabled but gi-extension missing')
75 message('@0@ extensions not found, not building documentation requiring it'.format(extension))
81 foreach f: ['gesmarshal.*',
83 'ges-auto-transition.*',
84 'ges-structured-interface.*',
85 'ges-structure-parser.*',
88 'ges-command-line-formatter.*',
89 'ges-base-xml-formatter.h',
90 'gstframepositioner.*',
91 'lex.priv_ges_parse_yy.c',
93 ges_excludes += [join_paths(meson.current_source_dir(), '..', '..', 'ges', f)]
96 hotdoc = import('hotdoc')
97 libs_doc = [hotdoc.generate_doc('gst-editing-services',
98 project_version: apiversion,
99 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
100 gi_c_sources: ges_sources + ges_headers,
101 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../ges/')],
102 gi_sources: [ges_gir[0].full_path()],
103 gi_c_source_filters: ges_excludes,
104 sitemap: 'sitemap.txt',
106 gi_index: 'index.md',
107 gi_smart_index: true,
108 gi_order_generated_subpages: true,
109 dependencies: [ges_dep],
110 disable_incremental_build: true,
115 list_plugin_res = run_command(python3, '-c',
120 with open("@0@") as f:
121 print(':'.join(json.load(f).keys()), end='')
122 '''.format(plugins_cache),
124 foreach plugin_name: list_plugin_res.stdout().split(':')
125 plugins_doc += [hotdoc.generate_doc(plugin_name,
126 project_version: apiversion,
127 sitemap: 'plugins/sitemap.txt',
128 index: 'plugins/index.md',
129 gst_index: 'plugins/index.md',
130 gst_smart_index: true,
131 gst_c_sources: ['../plugins/*/*.[ch]',],
132 dependencies: [gst_dep],
133 gst_order_generated_subpages: true,
134 gst_cache_file: plugins_cache,
135 gst_plugin_name: plugin_name,