From 8b7b068d53db09597476fe84ce76edc5bb499b48 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 12 Oct 2021 15:52:48 -0300 Subject: [PATCH] meson: Streamline the way we detect when to build documentation Part-of: --- meson.build | 2 +- subprojects/gst-devtools/docs/meson.build | 19 ++++++++---- subprojects/gst-editing-services/docs/meson.build | 36 +++++++++++------------ subprojects/gst-plugins-bad/docs/meson.build | 35 +++++++++++----------- subprojects/gst-plugins-base/docs/meson.build | 28 ++++++++++++------ subprojects/gst-plugins-good/docs/meson.build | 2 +- subprojects/gst-plugins-ugly/docs/meson.build | 9 ++++++ subprojects/gst-rtsp-server/docs/meson.build | 36 +++++++++++------------ 8 files changed, 97 insertions(+), 70 deletions(-) diff --git a/meson.build b/meson.build index 79f3ee3..9a2fe49 100644 --- a/meson.build +++ b/meson.build @@ -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 += ',' diff --git a/subprojects/gst-devtools/docs/meson.build b/subprojects/gst-devtools/docs/meson.build index 287ddbc..560253e 100644 --- a/subprojects/gst-devtools/docs/meson.build +++ b/subprojects/gst-devtools/docs/meson.build @@ -9,22 +9,31 @@ if meson.is_cross_build() 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') +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 -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') + 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') + subdir_done() +endif + +required_hotdoc_extensions = ['gi-extension'] hotdoc = import('hotdoc') foreach extension: required_hotdoc_extensions if not hotdoc.has_extensions(extension) diff --git a/subprojects/gst-editing-services/docs/meson.build b/subprojects/gst-editing-services/docs/meson.build index baa4eee..9fa31f9 100644 --- a/subprojects/gst-editing-services/docs/meson.build +++ b/subprojects/gst-editing-services/docs/meson.build @@ -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.*', diff --git a/subprojects/gst-plugins-bad/docs/meson.build b/subprojects/gst-plugins-bad/docs/meson.build index 1c20b5c..8ad00de 100644 --- a/subprojects/gst-plugins-bad/docs/meson.build +++ b/subprojects/gst-plugins-bad/docs/meson.build @@ -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() diff --git a/subprojects/gst-plugins-base/docs/meson.build b/subprojects/gst-plugins-base/docs/meson.build index 797f53d..a7cc7f6 100644 --- a/subprojects/gst-plugins-base/docs/meson.build +++ b/subprojects/gst-plugins-base/docs/meson.build @@ -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) diff --git a/subprojects/gst-plugins-good/docs/meson.build b/subprojects/gst-plugins-good/docs/meson.build index bdfcc4a..2c12d1d 100644 --- a/subprojects/gst-plugins-good/docs/meson.build +++ b/subprojects/gst-plugins-good/docs/meson.build @@ -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') diff --git a/subprojects/gst-plugins-ugly/docs/meson.build b/subprojects/gst-plugins-ugly/docs/meson.build index 5b377e3..700cf7e 100644 --- a/subprojects/gst-plugins-ugly/docs/meson.build +++ b/subprojects/gst-plugins-ugly/docs/meson.build @@ -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' diff --git a/subprojects/gst-rtsp-server/docs/meson.build b/subprojects/gst-rtsp-server/docs/meson.build index 8060b74..b7245cc 100644 --- a/subprojects/gst-rtsp-server/docs/meson.build +++ b/subprojects/gst-rtsp-server/docs/meson.build @@ -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') -- 2.7.4