1build_hotdoc = false 2 3if 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() 10endif 11 12required_hotdoc_extensions = ['gst-extension'] 13if gst_dep.type_name() == 'internal' 14 gst_proj = subproject('gstreamer') 15 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') 16else 17 plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), 18 required: false) 19endif 20 21plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json') 22if plugins_cache_generator.found() 23 plugins_doc_dep = custom_target('libav-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 ) 29else 30 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache') 31endif 32 33hotdoc_p = find_program('hotdoc', required: get_option('doc')) 34if not hotdoc_p.found() 35 message('Hotdoc not found, not building the documentation') 36 subdir_done() 37endif 38 39hotdoc_req = '>= 0.11.0' 40hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout() 41if 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 48endif 49 50build_hotdoc = true 51hotdoc = import('hotdoc') 52docconf = configuration_data() 53docconf.set('GST_API_VERSION', api_version) 54 55foreach extension: required_hotdoc_extensions 56 if not hotdoc.has_extensions(extension) 57 if get_option('doc').enabled() 58 error('Documentation enabled but gi-extension missing') 59 endif 60 61 message('@0@ extensions not found, not building documentation requiring it'.format(extension)) 62 subdir_done() 63 endif 64endforeach 65 66 67libs_doc = [] 68plugins_doc = [hotdoc.generate_doc('libav', 69 project_version: api_version, 70 sitemap: 'sitemap.txt', 71 index: 'index.md', 72 gst_index: 'index.md', 73 gst_smart_index: true, 74 gst_c_sources: ['../ext/*/*.[ch]',], 75 gst_cache_file: plugins_cache, 76 gst_plugin_name: 'libav', 77 dependencies: [gst_dep, gstlibav_plugin, plugins_doc_dep], 78 disable_incremental_build: true, 79)] 80