Fix possible undefined reference when linking libusb from externals

When on Linux and using libusb from Externals, and with libudev
available, an "undefined reference" error message appears at link time.
This is due to a wrong define being set in CMake for libusb with
libudev. This causes the code for netlink being used instead of the
correct code for libudev support.

Fix the issue by setting the correct define so the correct libusb code
is used.
This commit is contained in:
sephiroth99 2017-01-06 04:13:51 -05:00
parent 440a2f832c
commit 2616192af3
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(usb PRIVATE "${LIBUDEV_LIBRARIES}")
target_include_directories(usb PRIVATE "${LIBUDEV_INCLUDE_DIR}")
set(HAVE_LIBUDEV TRUE)
set(USE_LIBUDEV TRUE)
set(USE_UDEV TRUE)
else()
target_sources(usb PRIVATE libusb/os/linux_netlink.c)
endif()