Skip to content

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

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

CMakeLists.txt: also link to additional package-config libraries#103
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost 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
Contributor

@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

@ghost ghost closed this by deleting the head repository Mar 5, 2026
This pull request was closed.
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.

1 participant