meson: Streamline the way we detect when to build documentation
authorThibault Saunier <tsaunier@igalia.com>
Tue, 12 Oct 2021 18:52:48 +0000 (15:52 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 15 Oct 2021 22:28:29 +0000 (19:28 -0300)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1093>

meson.build
subprojects/gst-devtools/docs/meson.build
subprojects/gst-editing-services/docs/meson.build
subprojects/gst-plugins-bad/docs/meson.build
subprojects/gst-plugins-base/docs/meson.build
subprojects/gst-plugins-good/docs/meson.build
subprojects/gst-plugins-ugly/docs/meson.build
subprojects/gst-rtsp-server/docs/meson.build

index 79f3ee3..9a2fe49 100644 (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 += ','
index 287ddbc..560253e 100644 (file)
@@ -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)
index baa4eee..9fa31f9 100644 (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.*',
index 1c20b5c..8ad00de 100644 (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()
index 797f53d..a7cc7f6 100644 (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)
index bdfcc4a..2c12d1d 100644 (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')
index 5b377e3..700cf7e 100644 (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'
index 8060b74..b7245cc 100644 (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')