Skip to content

Commit

Permalink
Auto merge of #295 - posborne:build-script-cleanup, r=kamalmarhubi
Browse files Browse the repository at this point in the history
test: clean up the test build script

Signed-off-by: Paul Osborne <[email protected]>
  • Loading branch information
homu committed Mar 6, 2016
2 parents 2a322a3 + b8f0535 commit 2f65a3f
Showing 1 changed file with 5 additions and 42 deletions.
47 changes: 5 additions & 42 deletions nix-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,9 @@ pub fn main() {
"UNKNOWN"
};

let mut config = gcc::Config::new();

for file in &["src/const.c", "src/sizes.c"] {
config.file(file);
}

config.define(os, None);

config.compile("libnixtest.a");
}

/*
use std::env;
use std::process::Command;
pub fn main() {
let root = env::var("CARGO_MANIFEST_DIR").unwrap();
let make = root.clone() + "/Makefile";
let src = root.clone() + "/src";
let out = env::var("OUT_DIR").unwrap();
let target = env::var("TARGET").unwrap();
let os = if target.contains("linux") {
"LINUX"
} else if target.contains("darwin") {
"DARWIN"
} else {
"UNKNOWN"
};
let res = Command::new("make")
.arg("-f").arg(&make)
.current_dir(&out)
.env("VPATH", &src)
.env("OS", os)
.spawn().unwrap()
.wait().unwrap();
assert!(res.success());
println!("cargo:rustc-flags=-L {}/", out);
gcc::Config::new()
.file("src/const.c")
.file("src/sizes.c")
.define(os, None)
.compile("libnixtest.a");
}
*/

0 comments on commit 2f65a3f

Please sign in to comment.