From 4cb871eb53c951e518149b41b5e0f44353e4ef1f Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 26 Mar 2020 15:57:17 -0400 Subject: [PATCH] v4l2codecs: Only build this plugin on Linux This is not useful on any other OSs, it will also avoid potential build failure as this code uses Linux specific calls. --- sys/v4l2codecs/meson.build | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/v4l2codecs/meson.build b/sys/v4l2codecs/meson.build index 89efe53..303f240 100644 --- a/sys/v4l2codecs/meson.build +++ b/sys/v4l2codecs/meson.build @@ -10,7 +10,20 @@ v4l2codecs_sources = [ libgudev_dep = dependency('gudev-1.0', required: get_option('v4l2codecs')) -if libgudev_dep.found() +if get_option('v4l2codecs').disabled() + have_v4l2 = false + message('V4L2 CODECs plugin is disabled') +else + # Should only be built on Linux, check for Linux kernel headers even though + # we have our own copy. + have_v4l2 = cc.has_header('linux/videodev2.h') + if get_option('v4l2codecs').enabled() and not have_v4l2 + error('V4L2i CODECs is requested but kernel headers were not found') + endif +endif + + +if have_v4l2 and libgudev_dep.found() gstv4l2codecs = library('gstv4l2codecs', v4l2codecs_sources, c_args : gst_plugins_bad_args, -- 2.7.4