meson: add a plugin summary
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 9 Jul 2020 07:46:07 +0000 (09:46 +0200)
committerStéphane Cerveau <scerveau@collabora.com>
Wed, 22 Jul 2020 10:15:36 +0000 (12:15 +0200)
This summary displays a list of plugins which
have been enabled.

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

meson.build

index a68f35a..95a8275 100644 (file)
@@ -582,3 +582,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")')
 install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal'))
+
+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