libslirp-sys issueshttps://gitlab.freedesktop.org/slirp/libslirp-sys/-/issues2022-05-06T06:48:47Zhttps://gitlab.freedesktop.org/slirp/libslirp-sys/-/issues/3New version for crates.io?2022-05-06T06:48:47ZNoahNew version for crates.io?Since !5 has been merged, could we make a new version of libslirp-sys on crates.io so folks can depend on the version w/ the fix?Since !5 has been merged, could we make a new version of libslirp-sys on crates.io so folks can depend on the version w/ the fix?https://gitlab.freedesktop.org/slirp/libslirp-sys/-/issues/1Support building on Windows2020-03-16T17:29:53ZNoahSupport building on WindowsThe current build.rs requires pkg_config to be present. On Windows, there isn't normally pkg_config unless running inside of an environment like msys. My project doesn't run in msys, so I modified build.rs to just emit rustc-link-lib on ...The current build.rs requires pkg_config to be present. On Windows, there isn't normally pkg_config unless running inside of an environment like msys. My project doesn't run in msys, so I modified build.rs to just emit rustc-link-lib on Windows, and then handled setting the link search paths as appropriate from my project's build scripts.
If possible, I'd like to upstream the changes to libslirp-sys's build script (merge requests don't appear to be open, or I would've filed one directly). The diff looks like this:
```
--- a/build.rs
+++ b/build.rs
@@ -1,5 +1,12 @@
extern crate pkg_config;
fn main() {
- pkg_config::find_library("slirp").unwrap();
+ #[cfg(target_os = "windows")]
+ {
+ println!("cargo:rustc-link-lib=libslirp");
+ }
+ #[cfg(not(target_os = "windows"))]
+ {
+ pkg_config::find_library("slirp").unwrap();
+ }
}
```
Does that seem like a reasonable approach?