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.')
12 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
13 if gst_dep.type_name() == 'internal'
14 gst_proj = subproject('gstreamer')
15 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
17 plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
21 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
22 if plugins_cache_generator.found()
23 plugins_doc_dep = custom_target('base-plugins-doc-cache',
24 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
26 output: 'gst_plugins_cache.json',
29 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
32 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
33 if not hotdoc_p.found()
34 message('Hotdoc not found, not building the documentation')
38 hotdoc = import('hotdoc')
39 foreach extension: required_hotdoc_extensions
40 if not hotdoc.has_extensions(extension)
41 if get_option('doc').enabled()
42 error('Documentation enabled but @0@ missing'.format(extension))
45 message('@0@ extension not found, not building documentation'.format(extension))
51 if get_option('doc').enabled()
52 error('Documentation enabled but introspection not built.')
55 message('Introspection not built, can\'t build the documentation')
60 docconf = configuration_data()
61 docconf.set('GST_API_VERSION', api_version)
63 version_entities = configure_file(input : 'version.in',
64 output : 'gst_api_version.md',
65 configuration : docconf)
68 foreach h: ['pbutils-private.h', 'gsttageditingprivate.h', 'id3v2.h',
69 'kiss_fft_f32.h', 'kiss_fft_f64.h', 'kiss_fftr_f32.h', 'kiss_fftr_f64.h',
70 'kiss_fftr_s16.h', 'kiss_fftr_s32.h', 'kiss_fft_s16.h', 'kiss_fft_s32.h',
71 '_kiss_fft_guts_f32.h', '_kiss_fft_guts_f64.h', '_kiss_fft_guts_s16.h',
72 '_kiss_fft_guts_s16.h', '_kiss_fft_guts_s32.h', '_kiss_fft_guts_s32.h',
73 'pbutils-marshal.h', 'audio-resampler-private.h', '*orc-dist.*',
74 '*-neon.h', 'audio-resampler-macros.[ch]', '*-prelude.h', '*_private.h',
75 'gstglfuncs.[ch]', 'gstgl_fwd.h'
78 libs_excludes += [join_paths(meson.current_source_dir(), '..', 'gst-libs/gst/*/', h)]
82 ['allocators', allocators_gir, allocators_dep],
83 ['app', app_gir, app_dep],
84 ['audio', audio_gir, audio_dep],
85 # FIXME! ['fft', fft_gir, fft_dep],
86 ['pbutils', pbutils_gir, pbutils_dep],
87 ['rtp', rtp_gir, rtp_dep],
88 ['rtsp', rtsp_gir, rtsp_dep],
89 ['sdp', sdp_gir, sdp_dep],
90 ['tag', tag_gir, tag_dep],
91 ['video', video_gir, video_dep],
95 libs += [['gl', gl_gir, gstgl_dep, [
96 join_paths('../gst-libs/gst', 'gl', 'egl', 'gstegl.[ch]'),
97 join_paths('../gst-libs/gst', 'gl', 'egl', 'gsteglimage.[ch]'),
98 join_paths('../gst-libs/gst', 'gl', 'egl', 'gstgldisplay_egl.[ch]'),
99 join_paths('../gst-libs/gst', 'gl', 'egl', 'gstglmemoryegl.[ch]'),
100 join_paths('../gst-libs/gst', 'gl', 'x11', 'gstgldisplay_x11.[ch]'),
101 join_paths('../gst-libs/gst', 'gl', 'wayland', 'gstgldisplay_wayland.[ch]'),
112 extra_sources = lib[3]
114 project_name = name == 'app' ? 'applib': name
115 libs_doc += [hotdoc.generate_doc(project_name,
116 project_version: api_version,
117 gi_c_sources: [join_paths('../gst-libs/gst', name, '*.[hc]')] + extra_sources,
118 gi_sources: gir[0].full_path(),
119 gi_c_source_filters: libs_excludes,
120 gi_c_source_roots: [join_paths(meson.current_source_dir(), '../gst-libs/gst/' + name), ],
121 sitemap: 'libs/' + name + '/sitemap.txt',
122 index: 'libs/' + name + '/index.md',
123 gi_index: 'libs/' + name + '/index.md',
124 gi_smart_index: true,
125 gi_order_generated_subpages: true,
131 if not hotdoc.has_extensions('c-extension')
132 if get_option('doc').enabled()
133 error('Documentation enabled but c-extension missing')
135 message('c-extension not found, not building documentation')
137 libs_doc += [hotdoc.generate_doc('riff',
138 project_version: api_version,
139 c_sources: ['../gst-libs/gst/riff/*.[hc]'],
140 c_source_filters: libs_excludes,
141 sitemap: 'libs/riff/sitemap.txt',
142 index: 'libs/riff/index.md',
143 c_index: 'libs/riff/index.md',
145 c_order_generated_subpages: true,
146 dependencies: [gst_base_dep, riff_dep],
148 disable_incremental_build: true,
153 sitemap = 'all_index.md\n'
155 list_plugin_res = run_command(python3, '-c',
160 with open("@0@") as f:
161 print(':'.join(json.load(f).keys()), end='')
162 '''.format(plugins_cache))
164 assert(list_plugin_res.returncode() == 0,
165 'Could not list plugins from @0@\n@1@\n@1@'.format(plugins_cache, list_plugin_res.stdout(), list_plugin_res.stderr()))
168 foreach plugin_name: list_plugin_res.stdout().split(':')
169 plugins_doc += [hotdoc.generate_doc(plugin_name,
170 project_version: api_version,
171 sitemap: 'plugins/sitemap.txt',
172 index: 'plugins/index.md',
173 gst_index: 'plugins/index.md',
174 gst_smart_index: true,
175 gst_c_sources: ['../sys/*/*.[ch]',
179 dependencies: [gst_dep, plugins],
180 gst_order_generated_subpages: true,
181 gst_cache_file: plugins_cache,
182 gst_plugin_name: plugin_name,
184 sitemap += ' @0@-doc.json\n'.format(plugin_name)