forked from CascadeOS/zig-sbi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
34 lines (26 loc) · 1001 Bytes
/
Copy pathbuild.zig
File metadata and controls
34 lines (26 loc) · 1001 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
27
28
29
30
31
32
33
34
const std = @import("std");
// TODO: https://github.com/ziglang/zig/issues/15301
const disable_risc32 = true;
pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Run library tests");
const optimize = b.standardOptimizeOption(.{});
const target_64 = std.zig.CrossTarget{ .cpu_arch = .riscv64, .os_tag = .freestanding };
const test_64 = b.addStaticLibrary(.{
.name = "test_64",
.root_source_file = .{ .path = "sbi.zig" },
.target = target_64,
.optimize = optimize,
});
test_step.dependOn(&test_64.step);
if (!disable_risc32) {
const target_32 = std.zig.CrossTarget{ .cpu_arch = .riscv32, .os_tag = .freestanding };
const test_32 = b.addStaticLibrary(.{
.name = "test_32",
.root_source_file = .{ .path = "sbi.zig" },
.target = target_32,
.optimize = optimize,
});
test_step.dependOn(&test_32.step);
}
b.default_step = test_step;
}