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(