-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild.rs
More file actions
34 lines (29 loc) · 1.3 KB
/
build.rs
File metadata and controls
34 lines (29 loc) · 1.3 KB
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
use cfg_aliases::cfg_aliases;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
cfg_aliases! {
// Systems.
android_platform: { target_os = "android" },
web_platform: { all(target_family = "wasm", target_os = "unknown") },
emscripten_platform: { all(target_family = "wasm", target_os = "emscripten") },
macos_platform: { target_os = "macos" },
ios_platform: { target_os = "ios" },
windows_platform: { target_os = "windows" },
linux_platform: { all(target_os = "linux", not(ohos)) },
desktop_platform: { any(windows_platform, linux_platform, macos_platform) },
apple: { any(target_os = "ios", target_os = "macos") },
free_unix: { all(unix, not(apple), not(android_platform), not(target_os = "emscripten")) },
redox: { target_os = "redox" },
ohos: { target_env = "ohos" },
// Native displays.
x11_platform: { all(free_unix, not(redox), not(ohos)) },
wayland_platform: { all(free_unix, not(redox), not(ohos)) },
orbital_platform: { redox },
// Systems
mobile_platform: { any(target_os = "ios", target_os = "android") },
// Available
fs_enabled: { not(target_family = "wasm") }
}
#[cfg(target_env = "ohos")]
napi_build_ohos::setup();
}