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