rtsp-media: Unblock all streams
[platform/upstream/gstreamer.git] / docs / meson.build
1 build_hotdoc = false
2
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.')
6     endif
7
8     message('Documentation not built as building it while cross building is not supported yet.')
9     subdir_done()
10 endif
11
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')
16 else
17     required_hotdoc_extensions += ['gst-extension']
18     plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
19         required: false)
20 endif
21
22 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
23 if plugins.length() == 0
24     message('All rtsp-server plugins have been disabled')
25 elif plugins_cache_generator.found()
26     plugins_doc_dep = custom_target('rtsp-server-plugins-doc-cache',
27         command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
28         input: plugins,
29         output: 'gst_plugins_cache.json',
30     )
31 else
32     warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
33 endif
34
35 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
36 if not hotdoc_p.found()
37     message('Hotdoc not found, not building the documentation')
38     subdir_done()
39 endif
40
41 hotdoc = import('hotdoc')
42 foreach extension: required_hotdoc_extensions
43     if not hotdoc.has_extensions(extension)
44         if get_option('doc').enabled()
45             error('Documentation enabled but @0@ missing'.format(extension))
46         endif
47
48         message('@0@ extension not found, not building documentation'.format(extension))
49         subdir_done()
50     endif
51 endforeach
52
53 if not build_gir
54     if get_option('doc').enabled()
55         error('Documentation enabled but introspection not built.')
56     endif
57
58     message('Introspection not built, can\'t build the documentation')
59     subdir_done()
60 endif
61
62 build_hotdoc = true
63 hotdoc = import('hotdoc')
64
65 libs_doc = [hotdoc.generate_doc('gst-rtsp-server',
66     project_version: api_version,
67     gi_c_sources: ['../gst/rtsp-server/*.[hc]'],
68     gi_sources: rtsp_server_gir[0].full_path(),
69     sitemap: 'sitemap.txt',
70     index: 'index.md',
71     gi_index: 'index.md',
72     gi_smart_index: true,
73     gi_order_generated_subpages: true,
74 )]
75
76 plugins_doc = [hotdoc.generate_doc('rtspclientsink',
77     project_version: api_version,
78     sitemap: 'plugin-sitemap.txt',
79     index: 'plugin-index.md',
80     gst_index: 'plugin-index.md',
81     gst_c_sources: ['../gst/rtsp-sink/*.[ch]'],
82     gst_dl_sources: [rtspsink.full_path()],
83     gst_smart_index: true,
84     dependencies: gst_rtsp_server_deps + [rtspsink],
85     gst_cache_file: plugins_cache,
86     gst_plugin_name: 'rtspclientsink',
87 )]
88 doc = libs_doc[0]