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.')
12 if get_option('doc').enabled()
13 error('Documentation enabled but not supported when building statically.')
16 message('Building statically, can\'t build the documentation')
20 hotdoc_plugin_scanner = executable('gst-hotdoc-plugins-scanner',
21 'gst-hotdoc-plugins-scanner.c',
24 include_directories : [configinc],
25 dependencies : [gst_dep, gmodule_dep, gio_dep],
26 install_dir : helpers_install_dir,
27 link_with: [printf_lib],
32 input: 'gst-plugins-doc-cache-generator.py',
33 output: 'gst-plugins-doc-cache-generator',
34 install_dir: helpers_install_dir,
38 plugins_cache_generator = find_program(join_paths(meson.current_build_dir(), 'gst-plugins-doc-cache-generator'))
39 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
40 gst_plugins_doc_dep = custom_target('build-doc-cache',
41 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
43 output: 'gst_plugins_cache.json',
44 depends: [hotdoc_plugin_scanner],
45 build_always_stale: true,
48 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
49 if not hotdoc_p.found()
50 message('Hotdoc not found, not building the documentation')
54 hotdoc_req = '>= 0.11.0'
55 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
56 if not hotdoc_version.version_compare(hotdoc_req)
57 if get_option('doc').enabled()
58 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
60 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
65 hotdoc = import('hotdoc')
66 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
67 foreach extension: required_hotdoc_extensions
68 if not hotdoc.has_extensions(extension)
69 if get_option('doc').enabled()
70 error('Documentation enabled but @0@ missing'.format(extension))
73 message('@0@ extension not found, not building documentation'.format(extension))
79 if get_option('doc').enabled()
80 error('Documentation enabled but not supported when building statically.')
83 message('Building statically, can\'t build the documentation')
88 if get_option('doc').enabled()
89 error('Documentation enabled but introspection not built.')
92 message('Introspection not built, can\'t build the documentation')
96 all_plugins_paths = []
98 all_plugins_paths += l.full_path()
102 docconf = configuration_data()
103 docconf.set('GST_API_VERSION', apiversion)
105 version_entities = configure_file(input : 'version.in',
106 output : 'gst_api_version.md',
107 configuration : docconf)
110 foreach h: ['gettext.h', 'glib-compat-private.h', 'glib-compat.h',
112 'gstelementdetails.h', 'gstmacros.h', 'gstmarshal.h',
113 'math-compat.h', 'parse/grammar.tab.h',
114 '../libs/gst/base/gstindex.h',
115 '../libs/gst/base/gstindex.c',
116 '../libs/gst/check/internal-check.h',
117 'parser/grammar.tab.pre.h', 'parse/parse_lex.h', 'types.h',
118 'gst-printf.h', 'printf-args.h', 'printf-extension.h',
119 'printf-parse.h', 'vasnprintf.h', 'gstregistrybinary.c',
120 'gstregistrybinary.h', 'gstpluginloader.h', 'gstpluginloader.c']
121 gst_excludes += [join_paths(meson.current_source_dir(), '..', 'gst', h)]
124 libs_doc = [hotdoc.generate_doc('gstreamer',
125 project_version: apiversion,
126 gi_c_sources: '../gst/*.[hc]',
127 gi_sources: [gst_gir[0].full_path()],
128 gi_c_source_filters: gst_excludes,
129 sitemap: 'gst/sitemap.txt',
130 index: 'gst/index.md',
131 gi_index: 'gst/gi-index.md',
132 gi_smart_index: true,
133 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../gst/'), ],
134 dependencies: [gst_dep, gmodule_dep],
135 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
140 ['base', gst_base_gir, gst_base_dep],
141 ['controller', gst_controller_gir, gst_controller_dep,],
142 ['net', gst_net_gir, gst_net_dep],
143 ['check', gst_check_gir, gst_check_dep],
150 libs_doc += [hotdoc.generate_doc(name,
151 project_version: apiversion,
152 gi_c_sources: ['../libs/gst/' + name + '/*.[hc]'],
153 gi_c_source_filters: gst_excludes,
154 gi_sources: gir[0].full_path(),
155 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../libs/gst/' + name), ],
156 sitemap: join_paths('libs', name, 'sitemap.txt'),
157 index: join_paths('libs/', name, 'index.md'),
158 gi_index: join_paths('libs/', name, 'index.md'),
159 gi_smart_index: true,
160 gi_order_generated_subpages: true,
168 hotdoc.generate_doc('coreelements',
169 project_version: apiversion,
170 sitemap: 'plugins/sitemap.txt',
171 index: 'plugins/index.md',
172 gst_index: 'plugins/index.md',
173 gst_smart_index: true,
174 gst_c_sources: ['../plugins/elements/*.c', '../plugins/elements/*.h'],
175 dependencies: [gst_plugins_doc_dep],
176 gst_cache_file: plugins_cache,
177 gst_plugin_name: 'coreelements',
179 hotdoc.generate_doc('coretracers',
180 project_version: apiversion,
181 sitemap: 'plugins/coretracers/sitemap.txt',
182 index: 'plugins/coretracers/index.md',
183 gst_index: 'plugins/coretracers/index.md',
184 gst_smart_index: true,
185 gst_c_sources: ['../plugins/tracers/*.c', '../plugins/tracers/*.h'],
186 dependencies: [gst_plugins_doc_dep],
187 gst_cache_file: plugins_cache,
188 gst_plugin_name: 'coretracers',