summaryrefslogtreecommitdiffstats
path: root/third_party/rust/winapi-build/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/rust/winapi-build/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
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]);
+ }
+ }
+}