From 3e4330686fdad3e2db3f2e6b2f731f69db248d8e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 6 Jun 2024 15:17:25 +0530 Subject: [PATCH] meson: Only enable gtk4 examples when gtk4 is found Part-of: --- meson.build | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/meson.build b/meson.build index 78451549..c6599a64 100644 --- a/meson.build +++ b/meson.build @@ -208,32 +208,6 @@ plugins = { 'quinn': {'library': 'libgstquinn'}, } -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: @@ -332,6 +306,33 @@ if get_option('gtk4').allowed() endif endif +examples_opt = get_option('examples') +if examples_opt.allowed() and 'gtk4' in plugins + 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 + # Process plugins list default_library = get_option('default_library')