build: Fix meson build without v4l2

This commit is contained in:
Christoph Haag 2019-11-05 15:36:52 +01:00
parent c709b64ce2
commit 3b87d518c4
2 changed files with 2 additions and 1 deletions

View file

@ -138,6 +138,7 @@ if v4l2.found() and ('auto' in drivers or 'v4l2' in drivers)
if 'v4l2' not in drivers
drivers += ['v4l2']
endif
add_project_arguments('-DXRT_HAVE_V4L2', language: ['c', 'cpp'])
endif
if drivers.length() == 0 or drivers == ['auto']

View file

@ -673,7 +673,7 @@ open_video_device(struct xrt_prober *xp,
{
struct prober_device *pdev = (struct prober_device *)xpdev;
#ifdef XRT_OS_LINUX
#if defined(XRT_OS_LINUX) && defined(XRT_HAVE_V4L2)
if (pdev->num_v4ls == 0) {
return -1;
}