diff options
| author | pravic <[email protected]> | 2016-04-16 00:46:29 +0300 |
|---|---|---|
| committer | pravic <[email protected]> | 2016-04-16 00:46:29 +0300 |
| commit | 419308de54870bb2c7ebab4ac7d178aac0adb254 (patch) | |
| tree | ae66f5048fd52d57b319162e493fbbe9b03f7001 /examples/build.rs | |
| parent | `fn main` is required when building with `--target target.json` (diff) | |
| download | winapi-kmd-rs-419308de54870bb2c7ebab4ac7d178aac0adb254.tar.xz winapi-kmd-rs-419308de54870bb2c7ebab4ac7d178aac0adb254.zip | |
simplify build: remove links from toml and provide path to the libs via single build.rs
Diffstat (limited to 'examples/build.rs')
| -rw-r--r-- | examples/build.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/build.rs b/examples/build.rs new file mode 100644 index 0000000..06a0e4f --- /dev/null +++ b/examples/build.rs @@ -0,0 +1,12 @@ +use std::env; + +fn main() { + let target = env::var("TARGET").unwrap(); + let triple: Vec<_> = target.split('-').collect(); + let mapped = match triple.get(0) { + Some(&"i686") => "i386", + Some(&"x86_64") => "amd64", + _ => panic!("unknown architecture of {:?}", target), + }; + println!("cargo:rustc-link-search=../../../native/win7/{}", mapped); +} |