From 31a75051fadb3f2f4f0fa0ed6965ccfd8e3d4570 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 29 Jan 2025 22:40:33 +0100 Subject: [PATCH] Make failure when compiling objc2 on non-Apple platform clearer Should have helped with the confusion in: https://github.com/madsmtm/objc2/issues/663#issuecomment-2621219447 --- crates/block2/src/lib.rs | 2 +- crates/objc2/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/block2/src/lib.rs b/crates/block2/src/lib.rs index 023eb414e..dbc87d44c 100644 --- a/crates/block2/src/lib.rs +++ b/crates/block2/src/lib.rs @@ -396,7 +396,7 @@ extern crate std; feature = "unstable-objfw", )) ))] -compile_error!("A runtime must be selected"); +compile_error!("`block2` only works on Apple platforms. Pass `--target aarch64-apple-darwin` or similar to compile for macOS.\n(If you're absolutely certain that you want to use `block2` on Linux/Windows, you can specify that with the `gnustep-x-y`/`compiler-rt` Cargo features instead)."); #[cfg(any( all(feature = "compiler-rt", feature = "gnustep-1-7"), diff --git a/crates/objc2/src/lib.rs b/crates/objc2/src/lib.rs index c1b7f5c4d..57ec49129 100644 --- a/crates/objc2/src/lib.rs +++ b/crates/objc2/src/lib.rs @@ -203,7 +203,7 @@ compile_error!("The `std` feature currently must be enabled."); feature = "unstable-objfw", )) ))] -compile_error!("A runtime must be selected"); +compile_error!("`objc2` only works on Apple platforms. Pass `--target aarch64-apple-darwin` or similar to compile for macOS.\n(If you're absolutely certain that you're using GNUStep, you can specify that with the `gnustep-x-y` Cargo feature instead)."); #[cfg(all(feature = "gnustep-1-7", feature = "unstable-objfw"))] compile_error!("Only one runtime may be selected");