-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
59 lines (48 loc) · 1.33 KB
/
build.zig
File metadata and controls
59 lines (48 loc) · 1.33 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const std = @import("std");
pub fn build(b: *std.Build) !void {
const id = "peter.fly";
const exe = b.addExecutable(.{
.name = id,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
}),
.optimize = .ReleaseSmall,
}),
});
exe.root_module.addImport(
"ff",
b.dependency("ff", .{}).module("ff"),
);
exe.entry = .disabled;
exe.rdynamic = true;
b.installArtifact(exe);
const build_cmd = b.addSystemCommand(&[_][]const u8{
"firefly_cli",
"build",
"--no-tip",
});
const run_cmd = b.addSystemCommand(&[_][]const u8{
"firefly_cli",
"emulator",
"--",
"--id",
id,
});
run_cmd.step.dependOn(&build_cmd.step);
const run_step = b.step("run", "Run app in the Firefly Zero emulator");
run_step.dependOn(&run_cmd.step);
const spy_cmd = b.addSystemCommand(&[_][]const u8{
"spy",
"--exc",
".zig-cache",
"--inc",
"**/*.zig",
"-q",
"./spy.sh",
});
const spy_step = b.step("spy", "Run spy watching for file changes");
spy_step.dependOn(&spy_cmd.step);
}