forked from thi-ng/umbrella
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
34 lines (30 loc) · 1.32 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
const std = @import("std");
pub fn build(b: *std.Build) void {
// IMPORTANT: Due to being part of this monorepo, this version of the build file is
// slighty more complicated than needed...
//
// Please consult the thi.ng/wasm-api README for details!
// Outside the umbrella monorepo, the import path for that file will be (usually):
// node_modules/@thi.ng/wasm-api/zig/build.zig
const lib = @import("wasm-api-build.zig").wasmLib(b, .{
// Only needed for this monorepo!!
.base = "../../node_modules",
// Declare extra WASM API packages to use
.modules = &.{
.{ .name = "wasm-api-canvas", .path = "@thi.ng/wasm-api-canvas/zig/lib.zig" },
.{ .name = "wasm-api-dom", .path = "@thi.ng/wasm-api-dom/zig/lib.zig" },
},
// build mode override
.optimize = .ReleaseSmall,
});
b.installArtifact(lib);
const installDocs = b.addInstallDirectory(.{
.source_dir = lib.getEmittedDocs(),
// .prefix here means the default build output dir (aka /zig-out)
// can be overridden using -p CLI arg (see `docs` script alias in package.json)
.install_dir = .prefix,
.install_subdir = "docs",
});
const docsStep = b.step("docs", "Generate documentation");
docsStep.dependOn(&installDocs.step);
}