Unverified Commit d03fd7e3 authored by Ian Douglas Scott's avatar Ian Douglas Scott
Browse files

Determine default target based on LLVM triple at build

parent 9efeabe1
[package]
name = "pkgutils"
version = "0.1.1"
build = "build.rs"
[lib]
name = "pkgutils"
......
use std::env;
fn main() {
println!("cargo:rustc-env=PKG_DEFAULT_TARGET={}", env::var("TARGET").unwrap());
}
......@@ -129,10 +129,7 @@ fn main() {
).subcommand(SubCommand::with_name("upgrade")
).get_matches();
let target = matches.value_of("target")
.or(option_env!("TARGET"))
.expect(concat!("pkg was not compiled with a target, ",
"and --target was not specified"));
let target = matches.value_of("target").unwrap_or(env!("PKG_DEFAULT_TARGET"));
let repo = Repo::new(target);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment