diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:51:15 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:51:39 -0700 |
commit | ac7604616ab2e44ad12a9d8d5dd90dec15feb5cc (patch) | |
tree | 7fa9ecddf5cba16c5f763a5ec1124933b5b9f962 /build.rs |
add ASI controls
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..da6c74c --- /dev/null +++ b/build.rs @@ -0,0 +1,24 @@ +use std::collections::HashMap; +use std::env; + +fn main() { + let target = env::var("TARGET").unwrap(); + if !target.contains("linux") { + panic!("Non-linux build targets are not tested and may not have a corresponding driver at the moment."); + } + + let mut archmap: HashMap<&'static str, &'static str> = HashMap::new(); + archmap.insert("x86_64", "x64"); + archmap.insert("x86", "x86"); + archmap.insert("armv5", "armv5"); + archmap.insert("armv6", "armv6"); + archmap.insert("armv7", "armv7"); + archmap.insert("armv8", "armv8"); + for (arch, dir) in archmap.iter() { + if target.contains(arch) { + println!("cargo:rustc-link-search={}/lib/{}/", env::var("CARGO_MANIFEST_DIR").unwrap(), dir); + } + } + println!("cargo:rustc-link-lib=ASICamera2"); + println!("cargo:rustc-link-lib=qhyccd"); +} |