From e3e98da727ba7f83fb5fc568e74fd6cc16c0ea61 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Tue, 26 Jul 2022 15:49:32 -0400 Subject: [PATCH] meson: webrtc: ensure definition of libgstwebrtcnice_dep ... and skip if it's disabled. Fixes #1344 Part-of: --- subprojects/gst-plugins-bad/ext/webrtc/meson.build | 6 ++++++ .../gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/meson.build b/subprojects/gst-plugins-bad/ext/webrtc/meson.build index badcf2dc84..9536521f65 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/meson.build +++ b/subprojects/gst-plugins-bad/ext/webrtc/meson.build @@ -12,6 +12,12 @@ webrtc_sources = [ 'webrtcdatachannel.c', ] +webrtc_option = get_option('webrtc').require( + libgstwebrtcnice_dep.found(), error_message: 'webrtc plugin requires libgstwebrtcnice.') +if webrtc_option.disabled() + subdir_done() +endif + gstwebrtc_plugin = library('gstwebrtc', webrtc_sources, c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build index eb11203376..52d96b95c8 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build +++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build @@ -11,6 +11,8 @@ libgstwebrtcnice_headers = files([ 'nicetransport.h', ]) +libgstwebrtcnice_dep = dependency('', required : false) + libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('webrtc'), fallback : ['libnice', 'libnice_dep'], default_options: ['tests=disabled']) @@ -45,7 +47,7 @@ if libnice_dep.found() dependencies: deps, install: true, ) - + pkg_name = 'gstreamer-webrtc-nice-1.0' libraries += [[pkg_name, {'lib': libgstwebrtcnice}]] pkgconfig.generate(libgstwebrtcnice,