2 if meson.is_cross_build()
3 if get_option('doc').enabled()
4 error('Documentation enabled but building the doc while cross building is not supported yet.')
7 message('Documentation not built as building it while cross building is not supported yet.')
11 hotdoc_plugin_scanner = executable('gst-hotdoc-plugins-scanner',
12 'gst-hotdoc-plugins-scanner.c',
14 include_directories : [configinc],
15 dependencies : [gobject_dep, gmodule_dep, glib_dep, gio_dep, gst_dep],
16 install_dir : helpers_install_dir,
17 link_with: [printf_lib],
22 input: 'gst-plugins-doc-cache-generator.py',
23 output: 'gst-plugins-doc-cache-generator',
24 install_dir: helpers_install_dir,
28 plugins_cache_generator = find_program(join_paths(meson.current_build_dir(), 'gst-plugins-doc-cache-generator'))
29 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
30 plugins_doc_dep = custom_target('build-doc-cache',
31 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
33 output: 'gst_plugins_cache.json',
34 depends: [hotdoc_plugin_scanner],
35 build_always_stale: true,
38 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
39 if not hotdoc_p.found()
40 message('Hotdoc not found, not building the documentation')
44 hotdoc_req = '>= 0.11.0'
45 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
46 if not hotdoc_version.version_compare(hotdoc_req)
47 if get_option('doc').enabled()
48 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
50 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
55 hotdoc = import('hotdoc')
56 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
57 foreach extension: required_hotdoc_extensions
58 if not hotdoc.has_extensions(extension)
59 if get_option('doc').enabled()
60 error('Documentation enabled but @0@ missing'.format(extension))
63 message('@0@ extension not found, not building documentation'.format(extension))
70 if get_option('doc').enabled()
71 error('Documentation enabled but introspection not built.')
74 message('Introspection not built, can\'t build the documentation')
78 all_plugins_paths = []
80 all_plugins_paths += l.full_path()
84 docconf = configuration_data()
85 docconf.set('GST_API_VERSION', apiversion)
87 version_entities = configure_file(input : 'version.in',
88 output : 'gst_api_version.md',
89 configuration : docconf)
92 foreach h: ['gettext.h', 'glib-compat-private.h', 'glib-compat.h',
93 'gst-i18n-app.h', 'gst-i18n-lib.h', 'gst_private.h',
94 'gstelementdetails.h', 'gstmacros.h', 'gstmarshal.h',
95 'math-compat.h', 'parse/grammar.tab.h',
96 '../libs/gst/base/gstindex.h',
97 '../libs/gst/base/gstindex.c',
98 '../libs/gst/check/internal-check.h',
99 'parser/grammar.tab.pre.h', 'parse/parse_lex.h', 'types.h',
100 'gst-printf.h', 'printf-args.h', 'printf-extension.h',
101 'printf-parse.h', 'vasnprintf.h', 'gstregistrybinary.c',
102 'gstregistrybinary.h', 'gstpluginloader.h', 'gstpluginloader.c']
103 gst_excludes += [join_paths(meson.current_source_dir(), '..', 'gst', h)]
106 libs_doc = [hotdoc.generate_doc('gstreamer',
107 project_version: apiversion,
108 gi_c_sources: '../gst/*.[hc]',
109 gi_sources: [gst_gir[0].full_path()],
110 gi_c_source_filters: gst_excludes,
111 sitemap: 'gst/sitemap.txt',
112 index: 'gst/index.md',
113 gi_index: 'gst/gi-index.md',
114 gi_smart_index: true,
115 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../gst/'), ],
116 dependencies: [gst_dep, glib_dep, gobject_dep, gmodule_dep, hotdoc_plugin_scanner],
117 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
121 ['base', gst_base_gir, gst_base_dep],
122 ['controller', gst_controller_gir, gst_controller_dep,],
123 ['net', gst_net_gir, gst_net_dep],
124 ['check', gst_check_gir, gst_check_dep],
131 libs_doc += [hotdoc.generate_doc(name,
132 project_version: apiversion,
133 gi_c_sources: ['../libs/gst/' + name + '/*.[hc]'],
134 gi_c_source_filters: gst_excludes,
135 gi_sources: gir[0].full_path(),
136 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../libs/gst/' + name), ],
137 sitemap: join_paths('libs', name, 'sitemap.txt'),
138 index: join_paths('libs/', name, 'index.md'),
139 gi_index: join_paths('libs/', name, 'index.md'),
140 gi_smart_index: true,
141 gi_order_generated_subpages: true,
142 dependencies: deps + [hotdoc_plugin_scanner],
148 hotdoc.generate_doc('coreelements',
149 project_version: apiversion,
150 sitemap: 'plugins/sitemap.txt',
151 index: 'plugins/index.md',
152 gst_index: 'plugins/index.md',
153 gst_smart_index: true,
154 gst_c_sources: ['../plugins/elements/*.c', '../plugins/elements/*.h'],
155 dependencies: [plugins_doc_dep],
156 gst_cache_file: plugins_cache,
157 gst_plugin_name: 'coreelements',
159 hotdoc.generate_doc('coretracers',
160 project_version: apiversion,
161 sitemap: 'plugins/sitemap.txt',
162 index: 'plugins/blank.md',
163 gst_index: 'plugins/blank.md',
164 gst_smart_index: true,
165 gst_c_sources: ['../plugins/tracers/*.c', '../plugins/tracers/*.h'],
166 dependencies: [plugins_doc_dep],
167 gst_cache_file: plugins_cache,
168 gst_plugin_name: 'coretracers',