cmake: Fix v4l2 flag not being set

This commit is contained in:
Jakob Bornecrantz 2019-11-10 01:36:34 +00:00
parent c6e6ba7485
commit 76d6133142
2 changed files with 6 additions and 2 deletions

View file

@ -97,6 +97,10 @@ if(BUILD_WITH_LIBUDEV)
add_definitions(-DXRT_HAVE_LIBUDEV)
endif()
if(BUILD_DRIVER_V4L2)
add_definitions(-DXRT_HAVE_V4L2)
endif()
if(BUILD_WITH_LIBUSB)
add_definitions(-DXRT_HAVE_LIBUSB)
endif()

View file

@ -12,7 +12,7 @@
#include "util/u_debug.h"
#include "p_prober.h"
#ifdef XRT_OS_LINUX
#ifdef XRT_HAVE_V4L2
#include "v4l2/v4l2_interface.h"
#endif
@ -673,7 +673,7 @@ open_video_device(struct xrt_prober *xp,
{
struct prober_device *pdev = (struct prober_device *)xpdev;
#if defined(XRT_OS_LINUX) && defined(XRT_HAVE_V4L2)
#if defined(XRT_HAVE_V4L2)
if (pdev->num_v4ls == 0) {
return -1;
}