erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
900 stars 194 forks source link

Add support for getting libraries from vcpkg for MSVC ABI builds #178

Closed mcgoo closed 7 years ago

mcgoo commented 7 years ago

With vcpkg installed,

vcpkg install zeromq:x64-windows-static
cargo build

now works.

I removed #[link(name = "zmq")] from ffi.rs. This did not break the default style build for linux or mac - is it related to static linking, and if so how would I go about testing that? I did not emit a cargo:rustc-link-lib=zmq but I will do so if it is required.

I tested static and dynamic builds with x86_64-pc-windows-msvc. The zmq crate itself as of 0.8.1 does not appear to compile for i686-pc-windows-msvc.

mcgoo commented 7 years ago

Just realized that ffi.rs is generated by bindgen. I'll try again...

mcgoo commented 7 years ago

Hi. Sorry for all the churn - I was using your CI - I didn't realize I could just turn it on in my own account.

This is complete now and ready for your consideration. Thanks!

rotty commented 7 years ago

@mcgoo Could you rebase and squash your commits into one or more logical changesets on top of the current state of the release/v0.8 branch? I'd like to avoid to clutter the git history with commits that partially cancel each other out.

mcgoo commented 7 years ago

Thanks @rotty. How does this look?

There is a spurious failure on nightly at the moment.

erickt commented 7 years ago

Hello @mcgoo! This is an interesting project, and sounds pretty useful. I'll let @rotty decide on whether or not to merge it, since he's maintaining rust-zmq these days. I did restart the build and it passed this time around.

One thing we do have is we're using metadeps to declaratively discover dependencies. Since it looks like you created vcpkg, would you be interested in extending it to support toml metadata, rather than encoding it into code? It also might be interesting for you to partner up with metadeps to make this functionality cross platform.

mcgoo commented 7 years ago

Thanks. I have been eyeing metadeps - it would be great to add vcpkg support to it although I think the rename-the-import-library workaround that is required in this particular case would preclude its use.