forked from doukutsu-rs/doukutsu-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
38 lines (31 loc) · 1.2 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use std::env;
#[cfg(target_os = "windows")]
extern crate winres;
fn main() {
// let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
let target = env::var("TARGET").unwrap_or_else(|e| panic!("{}", e));
let is_android = cfg!(target_os = "android") || (cfg!(target_os = "linux") && target.contains("android")); // hack
println!("cargo:rerun-if-changed=build.rs");
#[cfg(target_os = "windows")]
{
let mut res = winres::WindowsResource::new();
res.set_icon("res/sue.ico");
res.compile().unwrap();
if target.contains("i686") {
// yet another hack
println!("cargo:rustc-link-arg=/FORCE:MULTIPLE");
println!("cargo:rustc-link-lib=shlwapi");
}
}
if target.contains("darwin") {
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15");
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");
}
if is_android {
println!("cargo:rustc-link-lib=dylib=GLESv2");
println!("cargo:rustc-link-lib=dylib=EGL");
}
}