meson: Streamline the way we detect when to build documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1093>
This commit is contained in:
Thibault Saunier 2021-10-12 15:52:48 -03:00
parent 8d3c1317b3
commit 8b7b068d53
8 changed files with 101 additions and 74 deletions

View file

@ -148,7 +148,7 @@ foreach sp : subprojects
if not meson.is_cross_build() and build_infos.get('build-hotdoc', false)
if plugins.length() > 0
plugins_doc_caches += [subproj.get_variable('plugins_doc_dep')]
plugins_doc_caches += [subproj.get_variable('plugins_doc_dep', [])]
endif
if documented_projects != ''
documented_projects += ','

View file

@ -9,6 +9,24 @@ if meson.is_cross_build()
subdir_done()
endif
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, won\'t build documentation requiring it')
subdir_done()
endif
hotdoc_p = find_program('hotdoc', required: get_option('doc'))
if not hotdoc_p.found()
message('Hotdoc not found, not building the documentation')
@ -16,15 +34,6 @@ if not hotdoc_p.found()
endif
required_hotdoc_extensions = ['gi-extension']
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, can\'t build the documentation')
subdir_done()
endif
hotdoc = import('hotdoc')
foreach extension: required_hotdoc_extensions
if not hotdoc.has_extensions(extension)

View file

@ -9,6 +9,24 @@ if meson.is_cross_build()
subdir_done()
endif
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, won\'t build documentation requiring it')
subdir_done()
endif
required_hotdoc_extensions = ['gi-extension', 'gst-extension']
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')
@ -58,24 +76,6 @@ foreach extension: required_hotdoc_extensions
endif
endforeach
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, can\'t build the documentation')
subdir_done()
endif
build_hotdoc = true
ges_excludes = []
foreach f: ['gesmarshal.*',

View file

@ -9,6 +9,23 @@ if meson.is_cross_build()
subdir_done()
endif
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, won\'t build documentation requiring it')
endif
required_hotdoc_extensions = ['gi-extension', 'c-extension', 'gst-extension']
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')
@ -61,24 +78,6 @@ foreach extension: required_hotdoc_extensions
endif
endforeach
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, won\'t build documentation requiring it')
subdir_done()
endif
build_hotdoc = true
docconf = configuration_data()

View file

@ -9,6 +9,25 @@ if meson.is_cross_build()
subdir_done()
endif
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, won\'t build documentation requiring it')
subdir_done()
endif
required_hotdoc_extensions = ['gi-extension', 'gst-extension']
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')
@ -61,15 +80,6 @@ foreach extension: required_hotdoc_extensions
endif
endforeach
if not build_gir or static_build
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, can\'t build the documentation')
subdir_done()
endif
build_hotdoc = true
docconf = configuration_data()
docconf.set('GST_API_VERSION', api_version)

View file

@ -9,7 +9,7 @@ if meson.is_cross_build()
subdir_done()
endif
required_hotdoc_extensions = ['gi-extension', 'gst-extension']
required_hotdoc_extensions = ['gst-extension']
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')
plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')

View file

@ -1,5 +1,14 @@
build_hotdoc = false
if meson.is_cross_build()
if get_option('doc').enabled()
error('Documentation enabled but building the doc while cross building is not supported yet.')
endif
message('Documentation not built as building it while cross building is not supported yet.')
subdir_done()
endif
required_hotdoc_extensions = ['gst-extension']
plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
if gst_dep.type_name() == 'internal'

View file

@ -9,6 +9,24 @@ if meson.is_cross_build()
subdir_done()
endif
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, can\'t build the documentation')
subdir_done()
endif
required_hotdoc_extensions = ['gi-extension', 'gst-extension']
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')
@ -61,24 +79,6 @@ foreach extension: required_hotdoc_extensions
endif
endforeach
if static_build
if get_option('doc').enabled()
error('Documentation enabled but not supported when building statically.')
endif
message('Building statically, can\'t build the documentation')
subdir_done()
endif
if not build_gir
if get_option('doc').enabled()
error('Documentation enabled but introspection not built.')
endif
message('Introspection not built, can\'t build the documentation')
subdir_done()
endif
build_hotdoc = true
hotdoc = import('hotdoc')