forked from wasm3/wasm3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
39 lines (35 loc) · 1.14 KB
/
build.zig
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
30
31
32
33
34
35
36
37
38
39
const std = @import("std");
pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const wasm3 = b.addExecutable("wasm3", null);
wasm3.setTarget(target);
wasm3.setBuildMode(mode);
wasm3.install();
wasm3.linkLibC();
if (target.getCpuArch() == .wasm32 and target.getOsTag() == .wasi) {
wasm3.linkSystemLibrary("wasi-emulated-process-clocks");
}
wasm3.addIncludePath("source");
wasm3.addCSourceFiles(&.{
"source/m3_api_libc.c",
"source/m3_api_meta_wasi.c",
"source/m3_api_tracer.c",
"source/m3_api_uvwasi.c",
"source/m3_api_wasi.c",
"source/m3_bind.c",
"source/m3_code.c",
"source/m3_compile.c",
"source/m3_core.c",
"source/m3_env.c",
"source/m3_exec.c",
"source/m3_function.c",
"source/m3_info.c",
"source/m3_module.c",
"source/m3_parse.c",
"platforms/app/main.c",
}, &.{
"-Dd_m3HasWASI",
"-fno-sanitize=undefined", // TODO investigate UB sites in the codebase, then delete this line.
});
}