lipo for osx

This commit is contained in:
Colin Sherratt
2014-11-20 23:07:56 -05:00
parent c7c02f2129
commit 1786d54f10

View File

@@ -1,4 +1,5 @@
use std::io::Command;
#[cfg(target_os = "linux")]
use std::io::fs;
#[cfg(target_os = "linux")]
@@ -23,9 +24,13 @@ fn main() {
.arg("build")
.status()
.ok().expect("Failed to build");
fs::copy(&Path::new("modules/oculus_sdk_mac/LibOVR/Lib/MacOS/Release/libovr.a"),
&Path::new(env!("OUT_DIR")).join(Path::new("libovr.a")))
.ok().expect("Failed to move file");
Command::new("lipo")
.arg("modules/oculus_sdk_mac/LibOVR/Lib/MacOS/Release/libovr.a")
.arg("-thin")
.arg("x86_64")
.arg("-output")
.arg(Path::new(env!("OUT_DIR")).join(Path::new("libovr.a")).as_str().unwrap())
.status()
.ok().expect("Failed to lipo library");
println!("cargo:rustc-flags=-L {} -l ovr:static", env!("OUT_DIR"));
}