meson: webrtc: ensure definition of libgstwebrtcnice_dep
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 26 Jul 2022 19:49:32 +0000 (15:49 -0400)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 26 Jul 2022 21:39:52 +0000 (17:39 -0400)
... and skip if it's disabled.

Fixes #1344

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2797>

subprojects/gst-plugins-bad/ext/webrtc/meson.build
subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build

index badcf2d..9536521 100644 (file)
@@ -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'],
index eb11203..52d96b9 100644 (file)
@@ -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,