2015-11-23 04:55:38 +11:00
|
|
|
use std::env;
|
2018-05-19 05:58:55 +10:00
|
|
|
extern crate cc;
|
2015-11-23 04:55:38 +11:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let env = env::var("TARGET").unwrap();
|
|
|
|
if env.contains("darwin") {
|
2018-05-19 05:58:55 +10:00
|
|
|
cc::Build::new()
|
2018-10-24 05:51:50 +11:00
|
|
|
.flag("-mmacosx-version-min=10.10")
|
2018-05-19 05:58:55 +10:00
|
|
|
.file("src/native/macosx/MacMiniFB.m")
|
|
|
|
.file("src/native/macosx/OSXWindow.m")
|
|
|
|
.file("src/native/macosx/OSXWindowFrameView.m")
|
|
|
|
.compile("libminifb_native.a");
|
2018-10-24 05:51:50 +11:00
|
|
|
println!("cargo:rustc-link-lib=framework=Metal");
|
|
|
|
println!("cargo:rustc-link-lib=framework=MetalKit");
|
2019-12-16 18:24:48 +11:00
|
|
|
} else if !env.contains("windows") {
|
|
|
|
// build scalar on non-windows and non-mac
|
|
|
|
cc::Build::new()
|
|
|
|
.file("src/native/unix/scalar.cpp")
|
|
|
|
.opt_level(3) // always build with opts for scaler so it's fast in debug also
|
|
|
|
.compile("libscalar.a")
|
2015-11-23 04:55:38 +11:00
|
|
|
}
|
|
|
|
}
|