{build,wasmserve}: use wasmserve, drop apple_pie

This commit is contained in:
Ali Chraghi 2022-09-14 18:41:40 +04:30 committed by Stephen Gutekanst
parent ebb4b9c2fe
commit 5be9f04d85
18 changed files with 747 additions and 133 deletions

15
tools/wasmserve/build.zig Normal file
View file

@ -0,0 +1,15 @@
const std = @import("std");
const wasmserve = @import("wasmserve.zig");
pub fn build(b: *std.build.Builder) !void {
const mode = b.standardReleaseOptions();
const exe = b.addSharedLibrary("test", "test/main.zig", .unversioned);
exe.setBuildMode(mode);
exe.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding, .abi = .none });
exe.install();
const serve_step = try wasmserve.serve(exe, .{ .watch_paths = &.{"wasmserve.zig"} });
const run_step = b.step("test", "Start a testing server");
run_step.dependOn(&serve_step.step);
}