Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt: also link to additional package-config libraries #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BubuOT
Copy link

@BubuOT BubuOT commented Aug 7, 2024

LibUSB might specify additional libraries to link to via package-config (i.e. libatomic where this isn't a builtin [1]). These are correctly discovered by the call to pkg_check_modules and put into the PC_LIBUSB_LIBRARIES variable but then never added to the actual linking step.

Fix that by additionally adding them behind the libusb library discovered by the find_library call().

[1] https://github.com/libusb/libusb/blob/v1.0.27/configure.ac#L184

LibUSB might specify additional libraries to link to via package-config
(i.e. libatomic where this isn't a builtin [1]). These are correctly
discovered by the call to pkg_check_modules and put into the
PC_LIBUSB_LIBRARIES variable but then never added to the actual linking
step.

Fix that by additionally adding them behind the libusb library
discovered by the find_library call().

[1] https://github.com/libusb/libusb/blob/v1.0.27/configure.ac#L184
Copy link

@will-v-pi will-v-pi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to make this change in cmake/FindLIBUSB.cmake and append PC_LIBUSB_LIBRARIES to the LIBUSB_LIBRARIES variable, rather than using PC_LIBUSB_LIBRARIES in the main CMakeLists.txt

Also, could you target this at the develop branch instead of master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants