mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
st/prober: Guard libudev usage
This commit is contained in:
parent
542208bd42
commit
7f07cee387
|
@ -7,24 +7,34 @@ include_directories(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/../../../external
|
||||
)
|
||||
|
||||
set(PROBER_INCLUDES)
|
||||
|
||||
set(PROBER_SOURCE_FILES
|
||||
p_auto_wrap.c
|
||||
p_documentation.h
|
||||
p_dump.c
|
||||
p_prober.c
|
||||
p_prober.h
|
||||
p_udev.c
|
||||
)
|
||||
|
||||
# Add libudev
|
||||
if(BUILD_WITH_LIBUDEV)
|
||||
list(APPEND PROBER_SOURCE_FILES
|
||||
p_udev.c
|
||||
)
|
||||
list(APPEND PROBER_INCLUDES
|
||||
${LIBUDEV_INCLUDES}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Use OBJECT to not create a archive, since it just gets in the way.
|
||||
add_library(st_prober OBJECT ${PROBER_SOURCE_FILES})
|
||||
|
||||
target_include_directories(st_prober
|
||||
PRIVATE
|
||||
${PROBER_INCLUDES}
|
||||
${LIBUSB_INCLUDES}
|
||||
${LIBUVC_INCLUDES}
|
||||
${FFMPEG_INCLUDES}
|
||||
${OPENCV_INCLUDES}
|
||||
)
|
||||
|
||||
set_property(TARGET st_prober PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
|
|
@ -465,11 +465,13 @@ probe(struct xrt_prober* xp)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#ifdef XRT_HAVE_LIBUDEV
|
||||
ret = p_udev_probe(p);
|
||||
if (ret != 0) {
|
||||
P_ERROR(p, "Failed to enumerate udev devices\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
* @ingroup st_prober
|
||||
*/
|
||||
|
||||
#ifdef XRT_HAVE_LIBUDEV
|
||||
|
||||
#include "util/u_misc.h"
|
||||
#include "p_prober.h"
|
||||
|
||||
|
@ -341,5 +339,3 @@ p_udev_get_and_parse_uevent(struct udev_device* raw_dev,
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue