From 0c4d5808b807d5cf7ec3f65e5cbb1abeefebfbe6 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 8 May 2024 15:46:33 -0700 Subject: [PATCH] get more heavy-handed with compilation requirements --- build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.zig b/build.zig index e0aa461..206fde6 100644 --- a/build.zig +++ b/build.zig @@ -78,6 +78,10 @@ pub fn build(b: *std.Build) void { } pub fn configureBuild(b: *std.Build, cs: *std.Build.Step.Compile, function_name: []const u8) !void { + if (cs.rootModuleTarget().os.tag != .wasi) { + std.log.err("Error: Cloudflare builds require compilation with -Dtarget=wasm32-wasi", .{}); + return error.WasiCompilationRequired; + } const script = @embedFile("index.js"); const wasm_name = try std.fmt.allocPrint(b.allocator, "{s}.wasm", .{cs.name}); const deploy_cmd = CloudflareDeployStep.create(