Updated gcc -> cc 1.0

This commit is contained in:
Daniel Collin 2018-05-18 21:58:55 +02:00
parent 5e16895b7d
commit 8d7eb6b000
2 changed files with 10 additions and 7 deletions

View file

@ -16,7 +16,7 @@ appveyor = { repository = "emoon/rust-minifb" }
travis-ci = { repository = "emoon/rust_minifb" }
[build-dependencies]
gcc = "0.3.19"
cc = "1.0"
[dependencies]
time = "0.1.34"

View file

@ -1,14 +1,17 @@
use std::env;
extern crate gcc;
extern crate cc;
fn main() {
let env = env::var("TARGET").unwrap();
if env.contains("darwin") {
gcc::compile_library("libminifb_native.a",
&["src/native/macosx/MacMiniFB.m",
"src/native/macosx/OSXWindow.m",
"src/native/macosx/OSXWindowFrameView.m"]); // MacOS
cc::Build::new()
.file("src/native/macosx/MacMiniFB.m")
.file("src/native/macosx/OSXWindow.m")
.file("src/native/macosx/OSXWindowFrameView.m")
.compile("libminifb_native.a");
} else if env.contains("linux") {
gcc::compile_library("libminifb_native.a", &["src/native/x11/X11MiniFB.c"]); // Unix
cc::Build::new()
.file("src/native/x11/X11MiniFB.c")
.compile("libminifb_native.a");
}
}