Skip to content

Commit

Permalink
wgpu-hal: Give a more helpful error when no backends are enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Dec 2, 2022
1 parent 259317d commit 6124f8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wgpu-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
clippy::pattern_type_mismatch,
)]

#[cfg(not(any(
feature = "dx11",
feature = "dx12",
feature = "gles",
feature = "metal",
feature = "vulkan"
)))]
compile_error!("No back ends enabled in `wgpu-hal`. Enable at least one backend feature.");

#[cfg(all(feature = "metal", not(any(target_os = "macos", target_os = "ios"))))]
compile_error!("Metal API enabled on non-Apple OS. If your project is not using resolver=\"2\" in Cargo.toml, it should.");
#[cfg(all(feature = "dx12", not(windows)))]
Expand Down

0 comments on commit 6124f8e

Please sign in to comment.