From b8f0535127bd1d2b2750a9ffd31d8da9710465a2 Mon Sep 17 00:00:00 2001 From: Paul Osborne Date: Sat, 5 Mar 2016 18:01:09 -0600 Subject: [PATCH] test: clean up the test build script Signed-off-by: Paul Osborne --- nix-test/build.rs | 47 +++++------------------------------------------ 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/nix-test/build.rs b/nix-test/build.rs index 6717b48c93..0c18e1c824 100644 --- a/nix-test/build.rs +++ b/nix-test/build.rs @@ -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"); } -*/