meson: Only enable cargo features when options are enabled (bis)

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/285 even more.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1043>
This commit is contained in:
Philippe Normand 2023-01-11 14:07:15 +00:00 committed by GStreamer Marge Bot
parent 1a8abde884
commit f5e01b9196

View file

@ -293,6 +293,7 @@ examples = []
# Add the plugin library files as output
output = []
if get_option('gtk4').allowed()
if glib_dep.version().version_compare('>=2.74')
features += ['glib/v2_74', 'gio/v2_74']
elif glib_dep.version().version_compare('>=2.72')
@ -312,15 +313,22 @@ elif glib_dep.version().version_compare('>=2.60')
elif glib_dep.version().version_compare('>=2.58')
features += ['glib/v2_58', 'gio/v2_58']
endif
endif
if gst_dep.version().version_compare('>=1.21')
components = [
'', '-app', '-audio', '-base', '-check', '-net', '-pbutils',
'', '-app', '-audio', '-base', '-check',
'-rtp', '-sdp', '-utils', '-video', '-webrtc',
]
if get_option('tracers').allowed()
components += '-plugin-tracers'
endif
if get_option('threadshare').allowed()
components += '-net'
endif
if get_option('mp4').allowed() or get_option('fmp4').allowed()
components += '-pbutils'
endif
foreach c: components
features += f'gst@c@/v1_22'
endforeach