From 1dea4433403f2a3084bf583a658901d8239d4545 Mon Sep 17 00:00:00 2001 From: Alex S Date: Sat, 19 Jun 2021 14:19:39 +0300 Subject: [PATCH] Better compile error for not using resolver=2. --- wgpu-hal/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index 97e3c7c43..414240673 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -45,8 +45,11 @@ clippy::pattern_type_mismatch, )] +#[cfg(all(feature = "metal", not(any(target_os = "macos", target_os = "ios"))))] +compile_error!("Metal backend enabled on non-Apple OS. If your project is not using resolver=\"2\" in Cargo.toml, it should."); + mod empty; -#[cfg(feature = "metal")] +#[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))] mod metal; #[cfg(feature = "vulkan")] mod vulkan;