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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1438>
This commit is contained in:
Michael Tretter 2024-01-24 11:41:53 +01:00 committed by GStreamer Marge Bot
parent 33a1d8de3d
commit 54f24fe4b0

View file

@ -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