meson: Add explicit check: kwarg to all run_command() calls
[platform/upstream/gstreamer.git] / subprojects / gstreamer-vaapi / 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     plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
18         required: false)
19 endif
20
21 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
22 if plugins_cache_generator.found()
23     plugins_doc_dep = custom_target('vaapi-plugins-doc-cache',
24         command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
25         input: plugins,
26         output: 'gst_plugins_cache.json',
27         build_always_stale: true,
28     )
29 else
30     warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
31 endif
32
33 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
34 if not hotdoc_p.found()
35     message('Hotdoc not found, not building the documentation')
36     subdir_done()
37 endif
38
39 hotdoc_req = '>= 0.11.0'
40 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
41 if not hotdoc_version.version_compare(hotdoc_req)
42     if get_option('doc').enabled()
43         error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
44     else
45         message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
46         subdir_done()
47     endif
48 endif
49
50 build_hotdoc = true
51 hotdoc = import('hotdoc')
52 if not hotdoc.has_extensions(required_hotdoc_extensions)
53     if get_option('doc').enabled()
54         error('Documentation enabled but gi-extension missing')
55     endif
56
57     message('@0@ extensions not found, not building documentation'.format(required_hotdoc_extensions))
58     subdir_done()
59 endif
60
61 message('Plugins: @0@'.format(plugins))
62 libs_doc = []
63 plugins_doc = [hotdoc.generate_doc('vaapi',
64     project_version: api_version,
65     sitemap: 'sitemap.txt',
66     index: 'index.md',
67     gst_index: 'index.md',
68     gst_smart_index: true,
69     gst_c_sources: ['../gst/*/*.[ch]',],
70     gst_cache_file: plugins_cache,
71     gst_plugin_name: 'vaapi',
72     dependencies: [gstbase_dep, gstvideo_dep, gstallocators_dep, gstpbutils_dep,
73     libva_dep, gstlibvaapi_dep, gstgl_dep, libm] + plugins,
74 )]