2021-02-24 08:28:47 +00:00
|
|
|
use std::env;
|
|
|
|
|
|
|
|
// #[cfg(feature = "generate-gl")]
|
|
|
|
// use gl_generator::{Api, Fallbacks, Profile, Registry};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
|
2021-08-16 06:51:21 +00:00
|
|
|
let target = env::var("TARGET").unwrap_or_else(|e| panic!("{}", e));
|
2021-02-24 08:28:47 +00:00
|
|
|
let is_android = cfg!(target_os = "android") || (cfg!(target_os = "linux") && target.contains("android")); // hack
|
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
|
|
//
|
|
|
|
// #[cfg(feature = "generate-gl")]
|
|
|
|
// {
|
|
|
|
// let mut file = File::create(&dest.join("gl_bindings.rs")).unwrap();
|
|
|
|
//
|
|
|
|
// Registry::new(Api::Gles2, (3, 0), Profile::Core, Fallbacks::All, [])
|
|
|
|
// .write_bindings(gl_generator::StructGenerator, &mut file)
|
|
|
|
// .unwrap();
|
|
|
|
// }
|
|
|
|
|
2022-02-25 05:01:43 +00:00
|
|
|
if target.contains("darwin") {
|
|
|
|
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.12");
|
|
|
|
println!("cargo:rustc-link-arg=-weak_framework");
|
|
|
|
println!("cargo:rustc-link-arg=GameController");
|
|
|
|
println!("cargo:rustc-link-arg=-weak_framework");
|
|
|
|
println!("cargo:rustc-link-arg=CoreHaptics");
|
2021-08-13 01:46:41 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 08:28:47 +00:00
|
|
|
if is_android {
|
|
|
|
println!("cargo:rustc-link-lib=dylib=GLESv2");
|
|
|
|
println!("cargo:rustc-link-lib=dylib=EGL");
|
|
|
|
}
|
|
|
|
}
|