-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
35 lines (30 loc) · 916 Bytes
/
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
// #![recursion_limit = "256"]
use cfg_aliases::cfg_aliases;
fn main() {
// Doesn't work :( ... println!("cargo:rustc-cfg=feature=\"with-minifb\"");
cfg_aliases! {
// Platforms
wasm: { target_arch = "wasm32" },
android: { target_os = "android" },
macos: { target_os = "macos" },
linux: { target_os = "linux" },
windows: { target_os = "windows" },
// window providers
minifb: {
any(
all(macos, feature="minifb", not(wasm)),
all(linux, feature="minifb", not(wasm)),
all(windows, feature="minifb", not(wasm))
)
},
framebuffer: { all(linux, feature="framebuffer", not(wasm)) },
}
#[cfg(all(feature = "framebuffer", not(target_os = "linux")))]
{
panic!("framebuffer only supported on linux");
}
if std::env::var("TARGET").unwrap().contains("-apple") {
println!("cargo:rustc-link-lib=framework=Foundation");
println!("cargo:rustc-link-lib=framework=AVFAudio");
}
}