winapi-build-0.1.1/Cargo.toml000064400000000000000000000014631255674636100142360ustar0000000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g. crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "winapi-build" version = "0.1.1" authors = ["Peter Atashian "] description = "Common code for build.rs in WinAPI -sys crates." keywords = ["Windows", "FFI", "WinSDK"] license = "MIT" repository = "https://github.com/retep998/winapi-rs" [lib] name = "build" winapi-build-0.1.1/Cargo.toml.orig000064400000000000000000000004471255674636100151760ustar0000000000000000[package] name = "winapi-build" version = "0.1.1" authors = ["Peter Atashian "] 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" winapi-build-0.1.1/src/lib.rs000064400000000000000000000010471255674623300142050ustar0000000000000000// Copyright © 2015, Peter Atashian // Licensed under the MIT License 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]); } } }