2021-02-24 08:28:47 +00:00
|
|
|
use std::env;
|
|
|
|
|
2022-03-22 03:46:51 +00:00
|
|
|
#[cfg(target_os = "windows")]
|
2022-03-22 04:26:38 +00:00
|
|
|
extern crate winres;
|
2021-02-24 08:28:47 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=build.rs");
|
2022-03-22 17:49:25 +00:00
|
|
|
|
2024-12-23 09:50:21 +00:00
|
|
|
#[cfg(target_os = "windows")]
|
2024-12-23 09:43:25 +00:00
|
|
|
if target.contains("windows") {
|
2022-03-22 17:49:25 +00:00
|
|
|
let mut res = winres::WindowsResource::new();
|
2025-01-10 01:30:09 +00:00
|
|
|
res.set_icon("res/crabsue-icon.ico");
|
2022-03-22 17:49:25 +00:00
|
|
|
res.compile().unwrap();
|
2023-01-22 19:13:19 +00:00
|
|
|
|
|
|
|
if target.contains("i686") {
|
2024-12-23 09:43:25 +00:00
|
|
|
// hack
|
2023-01-22 19:13:19 +00:00
|
|
|
println!("cargo:rustc-link-arg=/FORCE:MULTIPLE");
|
2023-01-25 17:23:15 +00:00
|
|
|
println!("cargo:rustc-link-lib=shlwapi");
|
2023-01-22 19:13:19 +00:00
|
|
|
}
|
2024-12-23 09:50:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if target.contains("darwin") {
|
2022-02-28 18:13:27 +00:00
|
|
|
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15");
|
2022-02-25 05:01:43 +00:00
|
|
|
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");
|
2024-12-23 09:50:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if target.contains("android") {
|
2021-02-24 08:28:47 +00:00
|
|
|
println!("cargo:rustc-link-lib=dylib=GLESv2");
|
|
|
|
println!("cargo:rustc-link-lib=dylib=EGL");
|
|
|
|
}
|
|
|
|
}
|