-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
29 lines (26 loc) · 1.03 KB
/
Copy pathbuild.zig
File metadata and controls
29 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const std = @import("std");
const wasmserve = @import("libs/wasmserve.zig");
pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{
.default_target = std.zig.CrossTarget{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
.abi = .none,
},
});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "app",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.addAnonymousModule("zlm", .{ .source_file = .{ .path = "libs/zlm.zig" } });
exe.addAnonymousModule("sysjs", .{ .source_file = .{ .path = "libs/sysjs.zig" } });
exe.addAnonymousModule("qoi", .{ .source_file = .{ .path = "libs/qoi.zig" } });
exe.export_symbol_names = &.{ "wasmCallFunction" };
exe.install();
const serve_step = try wasmserve.serve(exe, .{});
const run_step = b.step("run", "Start a testing server");
run_step.dependOn(&serve_step.step);
}