From 54f24fe4b0770cce07ed9181aecb8150dc4680dc Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Wed, 24 Jan 2024 11:41:53 +0100 Subject: [PATCH] meson: allow building plugins with GTK 4 examples Only the examples of the fallbackswitch, livesync, and togglerecord plugins require the gtk, gio, and gst-plugin-gtk4 features. The plugins themselves don't actually have a dependency on GTK. Only add the features (and examples) if the examples are actually enabled to allow building these plugins without the GTK dependency. Part-of: --- meson.build | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 163f655f..b60ee8a4 100644 --- a/meson.build +++ b/meson.build @@ -201,6 +201,32 @@ plugins = { }, } +if get_option('examples').allowed() + plugins += { + 'fallbackswitch': { + 'library': 'libgstfallbackswitch', + 'examples': ['gtk-fallbackswitch'], + 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], + }, + 'livesync': { + 'library': 'libgstlivesync', + 'examples': ['gtk-livesync'], + 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], + }, + 'togglerecord': { + 'library': 'libgsttogglerecord', + 'examples': ['gtk-recording'], + 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], + }, + } +else + plugins += { + 'fallbackswitch': { 'library': 'libgstfallbackswitch'}, + 'livesync': { 'library': 'libgstlivesync'}, + 'togglerecord': { 'library': 'libgsttogglerecord'}, + } +endif + # Won't build on platforms where it bundles the sources because of: # https://github.com/qnighy/libwebp-sys2-rs/issues/12 # the fix is: @@ -279,21 +305,6 @@ if get_option('gtk4').allowed() 'extra-deps': {'gtk4': '>=4.6'}, 'features': gtk4_features, }, - 'fallbackswitch': { - 'library': 'libgstfallbackswitch', - 'examples': ['gtk-fallbackswitch'], - 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], - }, - 'livesync': { - 'library': 'libgstlivesync', - 'examples': ['gtk-livesync'], - 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], - }, - 'togglerecord': { - 'library': 'libgsttogglerecord', - 'examples': ['gtk-recording'], - 'features': ['gtk', 'gio', 'gst-plugin-gtk4'], - }, } endif