Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert <robert.ayrapetyan@gmail.com>2023-08-20 20:02:24 +0300
committerSebastian Dröge <sebastian@centricular.com>2023-09-20 19:23:55 +0300
commit105ffaa4a1d84263d0cc076de9d9e9c0c8768d0a (patch)
treef3c7d19b0345452311acf072d25a7451fd029c03
parent59214481ae4c9efcd0a0257cc8a6f195896ce0d6 (diff)
meson: Fix handling of optional deps
We were requiring the presence of all optional dependencies, such as gstreamer-check-1.0 and gstreamer-gl-1.0, on the system, regardless of whether the user actually requires these functionalities. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
-rw-r--r--meson.build56
-rw-r--r--meson_options.txt2
2 files changed, 39 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index 88a395a05..a35e48201 100644
--- a/meson.build
+++ b/meson.build
@@ -62,15 +62,31 @@ deps = [
['gstreamer-app-1.0', 'gst-plugins-base', 'app_dep', 'gstapp'],
['gstreamer-audio-1.0', 'gst-plugins-base', 'audio_dep', 'gstaudio'],
['gstreamer-base-1.0', 'gstreamer', 'gst_base_dep', 'gst_base'],
- ['gstreamer-check-1.0', 'gstreamer', 'gst_check_dep', 'gst_check'],
- ['gstreamer-gl-1.0', 'gst-plugins-base', 'gst_gl_dep', 'gstgl'],
- ['gstreamer-net-1.0', 'gstreamer', 'gst_net_dep', 'gst_net'],
- ['gstreamer-rtp-1.0', 'gst-plugins-base', 'rtp_dep', 'gst_rtp'],
- ['gstreamer-video-1.0', 'gst-plugins-base', 'video_dep', 'gstvideo'],
- ['gstreamer-sdp-1.0', 'gst-plugins-base', 'sdp_dep', 'gstsdp'],
- ['gstreamer-webrtc-1.0', 'gst-plugins-bad', 'gstwebrtc_dep', 'gstwebrtc'],
+ ['gstreamer-video-1.0', 'gst-plugins-base', 'video_dep', 'gstvideo']
]
+if get_option('threadshare').allowed() \
+ or get_option('onvif').allowed() \
+ or get_option('raptorq').allowed() \
+ or get_option('rtp').allowed() \
+ or get_option('webrtc').allowed()
+ deps += [['gstreamer-rtp-1.0', 'gst-plugins-base', 'rtp_dep', 'gst_rtp']]
+endif
+if get_option('webrtc').allowed() \
+ or get_option('webrtchttp').allowed()
+ deps += [['gstreamer-webrtc-1.0', 'gst-plugins-bad', 'gstwebrtc_dep', 'gstwebrtc']]
+ deps += [['gstreamer-sdp-1.0', 'gst-plugins-base', 'sdp_dep', 'gstsdp']]
+endif
+if get_option('tests').allowed()
+ deps += [['gstreamer-check-1.0', 'gstreamer', 'gst_check_dep', 'gst_check']]
+endif
+if get_option('gtk4').allowed()
+ deps += [['gstreamer-gl-1.0', 'gst-plugins-base', 'gst_gl_dep', 'gstgl']]
+endif
+if get_option('threadshare').allowed()
+ deps += [['gstreamer-net-1.0', 'gstreamer', 'gst_net_dep', 'gst_net']]
+endif
+
glib_dep = dependency('glib-2.0', version: glib_req)
deps_cache += {'glib-2.0': glib_dep}
@@ -561,18 +577,20 @@ if get_option('examples').allowed() and examples.length() > 0
] + feature_args)
endif
-test('tests',
- cargo_wrapper,
- env: extra_env,
- args: ['test',
- meson.current_build_dir(),
- meson.current_source_dir(),
- meson.global_build_root(),
- target,
- get_option('prefix'),
- get_option('libdir'),
- '--packages', packages],
- timeout: 600)
+if get_option('tests').allowed()
+ test('tests',
+ cargo_wrapper,
+ env: extra_env,
+ args: ['test',
+ meson.current_build_dir(),
+ meson.current_source_dir(),
+ meson.global_build_root(),
+ target,
+ get_option('prefix'),
+ get_option('libdir'),
+ '--packages', packages],
+ timeout: 600)
+endif
summary({
'Plugins': plugin_names,
diff --git a/meson_options.txt b/meson_options.txt
index 033e586c6..82df6c194 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -62,3 +62,5 @@ option('doc', type: 'feature', value: 'auto', yield: true,
description: 'Enable documentation')
option('examples', type: 'feature', value: 'disabled', yield: true,
description: 'Build examples')
+option('tests', type : 'feature', value : 'auto', yield : true,
+ description : 'Build and enable unit tests')