Debian Codegraph @

third_party/rust/wgpu-hal/build.rs

raw
1 fn main() {
2 cfg_aliases::cfg_aliases! {
3 native: { not(target_arch = "wasm32") },
4 send_sync: { any(
5 not(target_arch = "wasm32"),
6 all(feature = "fragile-send-sync-non-atomic-wasm", not(target_feature = "atomics"))
7 ) },
8 webgl: { all(target_arch = "wasm32", not(target_os = "emscripten"), gles) },
9 Emscripten: { all(target_os = "emscripten", gles) },
10 dx12: { all(target_os = "windows", feature = "dx12") },
11 gles: { all(feature = "gles") },
12 // Within the GL ES backend, use `std` and be Send + Sync only if we are using a target
13 // that, among the ones where the GL ES backend is supported, has `std`.
14 gles_with_std: { all(
15 feature = "gles",
16 any(
17 not(target_arch = "wasm32"),
18 // Accept wasm32-unknown-unknown, which uniquely has a stub `std`
19 all(target_vendor = "unknown", target_os = "unknown"),
20 // Accept wasm32-unknown-emscripten and similar, which has a real `std`
21 target_os = "emscripten"
22 )
23 ) },
24 metal: { all(target_vendor = "apple", feature = "metal") },
25 vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") },
26 // ⚠️ Keep in sync with target.cfg() definition in Cargo.toml and cfg_alias in `wgpu` crate ⚠️
27 static_dxc: { all(target_os = "windows", feature = "static-dxc", not(target_arch = "aarch64")) },
28 supports_64bit_atomics: { target_has_atomic = "64" }
29 }
30 }