meson: webrtc: ensure definition of libgstwebrtcnice_dep

... and skip if it's disabled.

Fixes #1344

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2797>
This commit is contained in:
U. Artie Eoff 2022-07-26 15:49:32 -04:00
parent 3d63b8c326
commit e3e98da727
2 changed files with 9 additions and 1 deletions

View 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'],

View 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,