cmake: link libusb by its full path

pkg_check_modules gives both LIBUSB_LIBRARIES (bare names, -lusb-1.0) and
LIBUSB_LINK_LIBRARIES (absolute paths). Passing both links libusb twice,
and the bare name only resolves when libusb is in the default library
search path - which it is on Linux and is not under Homebrew on macOS,
where the link fails with "library not found for -lusb-1.0". The full
path alone is enough everywhere.
This commit is contained in:
Kevin Bradenstein
2026-09-08 07:16:25 +02:00
committed by Dominic Radermacher
parent 15ea891fad
commit 97a9576c6e
-1
View File
@@ -32,7 +32,6 @@ target_include_directories(${PROJECT_NAME} PUBLIC
target_link_libraries(${PROJECT_NAME} PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
${GD_LIBRARIES} ${GD_LIBRARIES}
${LIBUSB_LIBRARIES}
${LIBUSB_LINK_LIBRARIES} ${LIBUSB_LINK_LIBRARIES}
${Intl_LIBRARIES} ${Intl_LIBRARIES}
${ARGP_LIBRARIES} ${ARGP_LIBRARIES}