meson: Skip the plugins_doc_caches target if docs are disabled
authorNirbheek Chauhan <nirbheek@centricular.com>
Wed, 4 Dec 2024 18:36:58 +0000 (00:06 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 16 Dec 2024 18:52:20 +0000 (18:52 +0000)
This is a follow-up to 95eca6d91912620a8a36b55ae32f72a32bc2475b, due
to which the target existed, but was a no-op, and it was difficult to
notice why the plugin caches are not being generated, since the doc
option is disabled by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8120>

meson.build

index 3f034c69e6d4093cad79406996580acd3d6ebb21..b5448910e602441a4d9beb54421f43ae731a6467 100644 (file)
@@ -237,7 +237,7 @@ foreach sp : subprojects
 
     subprojects_names += [project_name]
 
-    if not meson.is_cross_build() and build_infos.get('build-hotdoc', false)
+    if not meson.is_cross_build() and build_infos.get('build-hotdoc', false) and get_option('doc').allowed()
       plugins_doc_caches += [subproj.get_variable('gst_plugins_doc_dep', [])]
       if documented_projects != ''
         documented_projects += ','
@@ -258,12 +258,16 @@ if glib_dep.type_name() == 'internal'
   endif
 endif
 
-gst_plugins_doc_dep = custom_target('plugins-doc-cache',
-  command: [python3, '-c', 'print("Built all doc caches")'],
-  input: plugins_doc_caches,
-  output: 'plugins_doc_caches',
-  capture: true,
-)
+if get_option('doc').allowed()
+  gst_plugins_doc_dep = custom_target('plugins-doc-cache',
+    command: [python3, '-c', 'print("Built all doc caches")'],
+    input: plugins_doc_caches,
+    output: 'plugins_doc_caches',
+    capture: true,
+  )
+else
+  message('doc option is disabled, will not generate targets for building plugins doc caches')
+endif
 
 gir_files = []
 gir_targets = []