CMake: Unset LIBUSB_LIBRARIES when using libusb submodule
If the system has libusb installed but USE_SYS_LIBUSB is false, the static libusb will link against the system libusb (as pkg_check_modules sets LIBUSB_LIBRARIES, and 3rdparty/libusb_cmake/libusb.cmake links the usb-1.0-static target with LIBUSB_LIBRARIES). Unset LIBUSB_LIBRARIES to avoid this when using the libusb submodule.
This commit is contained in:
Vendored
+1
@@ -131,6 +131,7 @@ else()
|
|||||||
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
|
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
|
||||||
else()
|
else()
|
||||||
# we don't have the system libusb, so we compile from submodule
|
# we don't have the system libusb, so we compile from submodule
|
||||||
|
unset(LIBUSB_LIBRARIES CACHE)
|
||||||
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
|
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user