-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
26 lines (21 loc) · 875 Bytes
/
build.zig
File metadata and controls
26 lines (21 loc) · 875 Bytes
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
const std = @import("std");
pub fn build(builder: *std.build.Builder) void {
const rp2040_target = std.zig.CrossTarget{
.cpu_arch = .thumb,
.cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m0plus },
.os_tag = .freestanding,
.abi = .gnueabi,
};
const build_mode = builder.standardReleaseOptions();
const exe = builder.addExecutable("schism.elf", "src/main.zig");
exe.single_threaded = true;
exe.link_function_sections = true;
exe.setTarget(rp2040_target);
exe.setBuildMode(build_mode);
exe.setLinkerScriptPath(std.build.FileSource.relative("src/schism/picosystem/lscript.ld"));
exe.install();
const exe_tests = builder.addTest("src/main.zig");
exe_tests.setBuildMode(build_mode);
const test_step = builder.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);
}