build/
lib.rs

1// Copyright © 2015, Peter Atashian
2// Licensed under the MIT License <LICENSE.md>
3pub fn link(name: &str, bundled: bool) {
4    use std::env::var;
5    let target = var("TARGET").unwrap();
6    let target: Vec<_> = target.split('-').collect();
7    if target.get(2) == Some(&"windows") {
8        println!("cargo:rustc-link-lib=dylib={}", name);
9        if bundled && target.get(3) == Some(&"gnu") {
10            let dir = var("CARGO_MANIFEST_DIR").unwrap();
11            println!("cargo:rustc-link-search=native={}/{}", dir, target[0]);
12        }
13    }
14}