You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
378 B
16 lines
378 B
7 years ago
|
extern crate cc;
|
||
|
use std::process::Command;
|
||
|
|
||
|
fn main() {
|
||
|
let output = Command::new("uname").output()
|
||
|
.expect("failed to get uname");
|
||
|
let compiler = match output.stdout.as_slice() {
|
||
|
b"Darwin\n" => "x86_64-elf-gcc",
|
||
|
b"Linux\n" => "gcc",
|
||
|
_ => panic!("unknown os")
|
||
|
};
|
||
|
cc::Build::new()
|
||
|
.compiler(compiler)
|
||
|
.file("src/test.c")
|
||
|
.compile("cobj");
|
||
|
}
|