rust_minifb/build.rs
Daniel Collin 8b3c2e9b37
Merge dev -> master (#119)
* Deprecated update_with_buffer and added a temporary (update_with_buffer_size) for now. This will later be removed and the update_with_buffer is requiring the size to bu suplied

* Reparation for 0.14 release

* Missed one case

* Minor cleanup

* Switch to C scalar for Unix + rename

Reason is so we can always use optimized scalar even in debug.
Also removed _size so only update_with_buffer(..) takes width, height of the input buffer

* Implemented AspectRatio aware scale on nix

* Implemented image center

* Added UpperLeft center mode for unix

* Moving macOS over to sized update

* Fixed resize not working on macOS

* WIP on macOS

* More WIP on macOS version

* Bunch of macOS updates and fixes

* Fixed broken bg color on macOS

* Windows fixes WIP

* Remove some spamming

* More windows fixes

* Windows fixes for cursor and warnings

* Some cleanup

* rustfmt pass

* Fixed typo

* Added support for limiting update rate

* Added update rate to Windows

* Added update rate to macOS

* Misc fixes

* Fixed resources and maintance badge

* Updated readme

* Updated changelog

* Added rate limit
2019-12-16 08:24:48 +01:00

23 lines
816 B
Rust

use std::env;
extern crate cc;
fn main() {
let env = env::var("TARGET").unwrap();
if env.contains("darwin") {
cc::Build::new()
.flag("-mmacosx-version-min=10.10")
.file("src/native/macosx/MacMiniFB.m")
.file("src/native/macosx/OSXWindow.m")
.file("src/native/macosx/OSXWindowFrameView.m")
.compile("libminifb_native.a");
println!("cargo:rustc-link-lib=framework=Metal");
println!("cargo:rustc-link-lib=framework=MetalKit");
} 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")
}
}