-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
25 lines (21 loc) · 939 Bytes
/
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
const Builder = @import("std").Build;
const Target = @import("std").Target;
const CrossTarget = @import("std").Target.Query;
const ReleaseSmall = @import("std").builtin.OptimizeMode.ReleaseSmall;
pub fn build(b: *Builder) void {
const target = CrossTarget{
.cpu_arch = Target.Cpu.Arch.x86_64,
.os_tag = Target.Os.Tag.uefi,
};
const exe = b.addExecutable(.{
.name = "bootx64",
.root_source_file = b.path("main.zig"),
.target = b.resolveTargetQuery(target),
.optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = ReleaseSmall }),
.strip = true,
});
const smbios_module = b.addModule("smbios", .{ .root_source_file = b.path("libs/smbios.zig") });
exe.root_module.addImport("smbios", smbios_module);
const install = b.addInstallArtifact(exe, .{ .dest_dir = .{ .override = .{ .custom = "." } } });
b.default_step.dependOn(&install.step);
}