From d785e8f2d37c2d9bbe7f6ae7c39e94294397bc7e Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 26 Mar 2022 22:44:53 -0700 Subject: [PATCH] gpu-dawn: make macOS cross compilation errors more helpful Fixes hexops/mach#187 Signed-off-by: Stephen Gutekanst --- gpu-dawn/build.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index 261efe00..4c728da1 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -210,6 +210,11 @@ pub fn linkFromBinary(b: *Builder, step: *std.build.LibExeObjStep, options: Opti std.log.err("-> open an issue: https://github.com/hexops/mach/issues", .{}); std.log.err("-> build from source (takes 5-15 minutes):", .{}); std.log.err(" use -Ddawn-from-source=true or set `Options.from_source = true`\n", .{}); + if (target.os.tag == .macos) { + std.log.err("", .{}); + if (target.cpu.arch.isX86()) std.log.err("-> Did you mean to use -Dtarget=x86_64-macos.12 ?", .{}); + if (target.cpu.arch.isAARCH64()) std.log.err("-> Did you mean to use -Dtarget=aarch64-macos.12 ?", .{}); + } std.process.exit(1); }