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',
15 include_directories : [configinc],
16 dependencies : [gobject_dep, gmodule_dep, glib_dep, gio_dep, gst_dep],
17 install_dir : helpers_install_dir,
18 link_with: [printf_lib],
23 input: 'gst-plugins-doc-cache-generator.py',
24 output: 'gst-plugins-doc-cache-generator',
25 install_dir: helpers_install_dir,
29 plugins_cache_generator = find_program(join_paths(meson.current_build_dir(), 'gst-plugins-doc-cache-generator'))
30 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
31 plugins_doc_dep = custom_target('build-doc-cache',
32 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
34 output: 'gst_plugins_cache.json',
35 depends: [hotdoc_plugin_scanner],
36 build_always_stale: true,
39 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
40 if not hotdoc_p.found()
41 message('Hotdoc not found, not building the documentation')
45 hotdoc_req = '>= 0.11.0'
46 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
47 if not hotdoc_version.version_compare(hotdoc_req)
48 if get_option('doc').enabled()
49 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
51 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
56 hotdoc = import('hotdoc')
57 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
58 foreach extension: required_hotdoc_extensions
59 if not hotdoc.has_extensions(extension)
60 if get_option('doc').enabled()
61 error('Documentation enabled but @0@ missing'.format(extension))
64 message('@0@ extension not found, not building documentation'.format(extension))
70 if get_option('doc').enabled()
71 error('Documentation enabled but not supported when building statically.')
74 message('Building statically, can\'t build the documentation')
79 if get_option('doc').enabled()
80 error('Documentation enabled but introspection not built.')
83 message('Introspection not built, can\'t build the documentation')
87 all_plugins_paths = []
89 all_plugins_paths += l.full_path()
93 docconf = configuration_data()
94 docconf.set('GST_API_VERSION', apiversion)
96 version_entities = configure_file(input : 'version.in',
97 output : 'gst_api_version.md',
98 configuration : docconf)
101 foreach h: ['gettext.h', 'glib-compat-private.h', 'glib-compat.h',
102 'gst-i18n-app.h', 'gst-i18n-lib.h', 'gst_private.h',
103 'gstelementdetails.h', 'gstmacros.h', 'gstmarshal.h',
104 'math-compat.h', 'parse/grammar.tab.h',
105 '../libs/gst/base/gstindex.h',
106 '../libs/gst/base/gstindex.c',
107 '../libs/gst/check/internal-check.h',
108 'parser/grammar.tab.pre.h', 'parse/parse_lex.h', 'types.h',
109 'gst-printf.h', 'printf-args.h', 'printf-extension.h',
110 'printf-parse.h', 'vasnprintf.h', 'gstregistrybinary.c',
111 'gstregistrybinary.h', 'gstpluginloader.h', 'gstpluginloader.c']
112 gst_excludes += [join_paths(meson.current_source_dir(), '..', 'gst', h)]
115 libs_doc = [hotdoc.generate_doc('gstreamer',
116 project_version: apiversion,
117 gi_c_sources: '../gst/*.[hc]',
118 gi_sources: [gst_gir[0].full_path()],
119 gi_c_source_filters: gst_excludes,
120 sitemap: 'gst/sitemap.txt',
121 index: 'gst/index.md',
122 gi_index: 'gst/gi-index.md',
123 gi_smart_index: true,
124 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../gst/'), ],
125 dependencies: [gst_dep, glib_dep, gobject_dep, gmodule_dep, hotdoc_plugin_scanner],
126 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
130 ['base', gst_base_gir, gst_base_dep],
131 ['controller', gst_controller_gir, gst_controller_dep,],
132 ['net', gst_net_gir, gst_net_dep],
133 ['check', gst_check_gir, gst_check_dep],
140 libs_doc += [hotdoc.generate_doc(name,
141 project_version: apiversion,
142 gi_c_sources: ['../libs/gst/' + name + '/*.[hc]'],
143 gi_c_source_filters: gst_excludes,
144 gi_sources: gir[0].full_path(),
145 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../libs/gst/' + name), ],
146 sitemap: join_paths('libs', name, 'sitemap.txt'),
147 index: join_paths('libs/', name, 'index.md'),
148 gi_index: join_paths('libs/', name, 'index.md'),
149 gi_smart_index: true,
150 gi_order_generated_subpages: true,
151 dependencies: deps + [hotdoc_plugin_scanner],
157 hotdoc.generate_doc('coreelements',
158 project_version: apiversion,
159 sitemap: 'plugins/sitemap.txt',
160 index: 'plugins/index.md',
161 gst_index: 'plugins/index.md',
162 gst_smart_index: true,
163 gst_c_sources: ['../plugins/elements/*.c', '../plugins/elements/*.h'],
164 dependencies: [plugins_doc_dep],
165 gst_cache_file: plugins_cache,
166 gst_plugin_name: 'coreelements',
168 hotdoc.generate_doc('coretracers',
169 project_version: apiversion,
170 sitemap: 'plugins/sitemap.txt',
171 index: 'plugins/blank.md',
172 gst_index: 'plugins/blank.md',
173 gst_smart_index: true,
174 gst_c_sources: ['../plugins/tracers/*.c', '../plugins/tracers/*.h'],
175 dependencies: [plugins_doc_dep],
176 gst_cache_file: plugins_cache,
177 gst_plugin_name: 'coretracers',