parent
7f872901ce
commit
8c7ca612e7
@ -0,0 +1,16 @@
|
|||||||
|
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");
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
int square(int x) {
|
||||||
|
return x * x;
|
||||||
|
}
|
Loading…
Reference in new issue