-
Notifications
You must be signed in to change notification settings - Fork 35
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
use build strategy from rust-openssl #5
base: master
Are you sure you want to change the base?
Conversation
@cmsd2 Interesting approach. I like the idea of being able to compile on Windows without using pkg-config. I'll try to find some time to look at this. No promises on a timeline though. I'll need to block off a good chunk of free time to read through it, and I'll have to re-setup my Windows VM to test it out. Thanks for the PR. |
Any updates on this? :) |
I'd like to test it but I'm not very familiar with manipulation on github: what do I need to do? |
@Geobert PR is a request to merge one branch (possible from another repository) to another. On the top you can see that
So just download/clone the @cmsd2' s repository and try it. If you want to test merged code, then add both repositories as git remotes, fetch both and try to merge into a single branch and test. |
By the way, you can use vcpkg and vcpkg-rs on Windows, you won't need to set environment variables manually then. |
I've hacked something by editing the build.rs in the registry folder |
ooh. vcpkg looks useful. |
I just succesfully built a windows binary using #5. [replace]
"libusb-sys:0.2.3"= { git = "https://github.com/cmsd2/libusb-sys/" } then export The change provides a very nice and helpfull error message if libusb is not found. |
Any updates? |
Hello all. I try to maintenance fork of this library https://crates.io/crates/libusb1-sys |
I just wanted to say thanks for this, the fork was incredibly much easier to get building than this repository. I used this configuration in my workspace Cargo.toml: [patch.crates-io]
libusb-sys = { git = "https://github.com/[my clone of the fork]/libusb-sys", rev = "096f247" } Edit: I spoke too soon. RLS works now, but the linker doesn't find something yet. Edit: |
On windows i've compiled libusb using msvc for x64.
To get libusb-rs and libusb-sys to compile I copied over and modified the build.rs from rust-openssl.
The approach is to allow the important bits to be overridden with environment variables, and falling back to pkg-config.
It should still work in a cross-compiling environment, but that'd be worth testing.
The env vars that I used with a built libusb were:
LIBUSB_INCLUDE_DIR=%HOME%\libusb\libusb LIBUSB_LIB_DIR=%HOME%\libusb\x64\Debug\dll