meson: add a plugin summary
authorStéphane Cerveau <scerveau@collabora.com>
Sat, 25 Jul 2020 20:19:20 +0000 (21:19 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 25 Jul 2020 20:19:20 +0000 (21:19 +0100)
This summary displays a list of plugins which
have been enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/65>

meson.build

index 174b1e7..7111f1e 100644 (file)
@@ -286,3 +286,18 @@ endif
 configure_file(output : 'config.h', configuration : cdata)
 
 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
+
+if meson.version().version_compare('>= 0.54')
+  plugin_names = []
+  foreach plugin: plugins
+    # FIXME: Use str.subtring() when we can depend on Meson 0.56
+    split = plugin.name().split('gst')
+    if split.length() == 2
+      plugin_names += [split[1]]
+    else
+      warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name())
+      plugin_names += [plugin.name()]
+    endif
+  endforeach
+  summary({'Plugins':plugin_names}, list_sep: ', ')
+endif