meson: Streamline the way we detect when to build documentation
[platform/upstream/gstreamer.git] / subprojects / gst-rtsp-server / docs / meson.build
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')