diff options
Diffstat (limited to 'third_party/rust/winapi-build')
-rw-r--r-- | third_party/rust/winapi-build/.cargo-checksum.json | 1 | ||||
-rw-r--r-- | third_party/rust/winapi-build/Cargo.toml | 11 | ||||
-rw-r--r-- | third_party/rust/winapi-build/src/lib.rs | 14 |
3 files changed, 26 insertions, 0 deletions
diff --git a/third_party/rust/winapi-build/.cargo-checksum.json b/third_party/rust/winapi-build/.cargo-checksum.json new file mode 100644 index 0000000000..4d5fc4c7ad --- /dev/null +++ b/third_party/rust/winapi-build/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"982633c62ba05c95429b1768896a54c9a032a40fbd1e11049a9b087e9fd89176","src/lib.rs":"1d88932534b784973d3d87ac18cd8f2a0294ce5166cf30488c68ca90443e1750"},"package":"2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"}
\ No newline at end of file diff --git a/third_party/rust/winapi-build/Cargo.toml b/third_party/rust/winapi-build/Cargo.toml new file mode 100644 index 0000000000..e1be0b184d --- /dev/null +++ b/third_party/rust/winapi-build/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "winapi-build" +version = "0.1.1" +authors = ["Peter Atashian <retep998@gmail.com>"] +description = "Common code for build.rs in WinAPI -sys crates." +repository = "https://github.com/retep998/winapi-rs" +keywords = ["Windows", "FFI", "WinSDK"] +license = "MIT" + +[lib] +name = "build" diff --git a/third_party/rust/winapi-build/src/lib.rs b/third_party/rust/winapi-build/src/lib.rs new file mode 100644 index 0000000000..fab0c6cdc5 --- /dev/null +++ b/third_party/rust/winapi-build/src/lib.rs @@ -0,0 +1,14 @@ +// Copyright © 2015, Peter Atashian +// Licensed under the MIT License <LICENSE.md> +pub fn link(name: &str, bundled: bool) { + use std::env::var; + let target = var("TARGET").unwrap(); + let target: Vec<_> = target.split('-').collect(); + if target.get(2) == Some(&"windows") { + println!("cargo:rustc-link-lib=dylib={}", name); + if bundled && target.get(3) == Some(&"gnu") { + let dir = var("CARGO_MANIFEST_DIR").unwrap(); + println!("cargo:rustc-link-search=native={}/{}", dir, target[0]); + } + } +} |