From 1328bdf7c2633f3f279e8ea949a258ff747c680e Mon Sep 17 00:00:00 2001 From: Froxcey Date: Wed, 31 Jan 2024 22:56:22 +0800 Subject: [PATCH 1/2] Provide Windows error message --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 0ccbb6f..a8a051e 100644 --- a/build.zig +++ b/build.zig @@ -3,6 +3,8 @@ const build_facilio = @import("facil.io/build.zig").build_facilio; pub fn build(b: *std.build.Builder) !void { const target = b.standardTargetOptions(.{}); + if (target.getOsTag() == .windows) + @panic("\nCurrently, Facil.io and Zap are not compatible with Windows. Consider using Linux or Windows Subsystem for Linux (WSL) instead.\nFor more information, please see:\n- https://github.com/zigzap/zap#most-faq\n- https://facil.io/#forking-contributing-and-all-that-jazz\n"); // Standard release options allow the person running `zig build` to select // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. const optimize = b.standardOptimizeOption(.{}); From 2f174bbceffa643cc666fd47e2d756ba3de11cd0 Mon Sep 17 00:00:00 2001 From: Froxcey Date: Mon, 19 Feb 2024 20:37:08 +0800 Subject: [PATCH 2/2] Use debug.err and exit 1 for windows fail message --- build.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index a8a051e..7279ee4 100644 --- a/build.zig +++ b/build.zig @@ -3,8 +3,10 @@ const build_facilio = @import("facil.io/build.zig").build_facilio; pub fn build(b: *std.build.Builder) !void { const target = b.standardTargetOptions(.{}); - if (target.getOsTag() == .windows) - @panic("\nCurrently, Facil.io and Zap are not compatible with Windows. Consider using Linux or Windows Subsystem for Linux (WSL) instead.\nFor more information, please see:\n- https://github.com/zigzap/zap#most-faq\n- https://facil.io/#forking-contributing-and-all-that-jazz\n"); + if (target.getOsTag() == .windows) { + std.log.err("\x1b[31mPlatform Not Supported\x1b[0m\nCurrently, Facil.io and Zap are not compatible with Windows. Consider using Linux or Windows Subsystem for Linux (WSL) instead.\nFor more information, please see:\n- https://github.com/zigzap/zap#most-faq\n- https://facil.io/#forking-contributing-and-all-that-jazz\n", .{}); + std.os.exit(1); + } // Standard release options allow the person running `zig build` to select // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. const optimize = b.standardOptimizeOption(.{});