Skip to content
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

Make it build on Windows #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libuv-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pkg-config = "0.3.6"

[dependencies]
libc = "0.1.10"
winapi = "0.2.7"

# [lib]
# crate-type = ["dylib"]
8 changes: 8 additions & 0 deletions libuv-sys/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# libuv-sys



# Building on Windows
In order to build libuv-sys on Windows, you must have :
* Python 2.7 (not 3.x) installed, and on PATH
* Rust MSVC toolchain (currently, GNU toolchains don't work)
6 changes: 5 additions & 1 deletion libuv-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ fn main() {
pkg_config::find_library("libuv").unwrap();
} else {
get_libuv();
println!("cargo:rustc-link-lib=static=uv");
if target.contains("windows") {
println!("cargo:rustc-link-lib=libuv");
} else {
println!("cargo:rustc-link-lib=static=uv");
}
println!("cargo:rustc-link-search=native={}",
env::current_dir().unwrap().join(libuv_lib().parent().unwrap()).to_str().unwrap());
if target.contains("linux") {
Expand Down
2 changes: 1 addition & 1 deletion libuv-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use winapi::{OVERLAPPED, HANDLE};

#[cfg(windows)]
mod variable_types {
use libc::c_uchar;
use libc::{c_uchar, c_char};
use winapi::{ULONG, SOCKET, HANDLE};
// undocumented
pub type uv_uid_t = c_uchar;
Expand Down