26 lines
685 B
Zig
26 lines
685 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
var arch_build_image: ?*const fn(*std.Build)void = null;
|
|
const target = b.standardTargetOptions(.{
|
|
.default_target = .{
|
|
.cpu_arch = .x86_64,
|
|
.os_tag = .freestanding,
|
|
.abi = .none,
|
|
}
|
|
});
|
|
if (target.query.cpu_arch) |arch| {
|
|
switch (arch) {
|
|
.x86_64 => {
|
|
arch_build_image = @import("arch/x86_64/build_arch.zig").buildImage;
|
|
},
|
|
else => {},
|
|
}
|
|
}
|
|
if (arch_build_image) |build_fn| {
|
|
build_fn(b);
|
|
} else {
|
|
@panic("Architecture not specified or unsupported");
|
|
}
|
|
}
|