Skip to content

[libusb] Fixing the error of not being able to locate Libusb header files.#35559

Closed
Zheng-Bicheng wants to merge 1 commit intomicrosoft:masterfrom
Zheng-Bicheng:fixed_libusb_bug
Closed

[libusb] Fixing the error of not being able to locate Libusb header files.#35559
Zheng-Bicheng wants to merge 1 commit intomicrosoft:masterfrom
Zheng-Bicheng:fixed_libusb_bug

Conversation

@Zheng-Bicheng
Copy link

No description provided.

@Zheng-Bicheng
Copy link
Author

Zheng-Bicheng commented Dec 8, 2023

I assume I have located and resolved this issue.

@Zheng-Bicheng
Copy link
Author

@JonLiu1993

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

No. The wrapper isn't a wrapper, and it is about to be removed: #35498
Use pkg_check_modules.
Or add an unofficial-libusb-config.cmake.

@JonLiu1993 JonLiu1993 added the category:port-bug The issue is with a library, which is something the port should already support label Dec 8, 2023
@Zheng-Bicheng
Copy link
Author

No. The wrapper isn't a wrapper, and it is about to be removed: #35498 Use pkg_check_modules. Or add an unofficial-libusb-config.cmake.

I'm sorry, I didn't understand what 'The wrapper isn't a wrapper' means; it runs fine after I made local modifications.If someone else has already submitted a PR to fix this issue, I can wait for the PR to be completed.

@dg0yt
Copy link
Contributor

dg0yt commented Dec 9, 2023

find_package(libusb) somewhat works because vcpkg loads vcpkg-make-wrapper.cmake.
But there is no official find modules or config for libusb which would define an official cmake interface. Wrapper are meant to complement the official interface, e.g. add transitive usage requirements. They shall not completely take over the role of find modules or config.

libusb provides usage information via pkg-config. This is the official, portable interface, and it can be used in CMake, although with some limitations.

If there is still a desire to provide (and maintain) a CMake package, the wrapper must be ported to an unofficial cmake config, with a distinct name and target namespace, to signal the lock-in effect.
https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#add-cmake-exports-in-an-unofficial--namespace

@JonLiu1993
Copy link
Contributor

Duplicate of #35498.

@JonLiu1993 JonLiu1993 closed this Dec 22, 2023
@JonLiu1993 JonLiu1993 changed the title Fixing the error of not being able to locate Libusb header files. [libusb] Fixing the error of not being able to locate Libusb header files. Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants