Use the standardTargetOptions for built targets
This will allow the user to build the OS with more fine grain, but there is a white list of supported build targets. Closes #129 Updated the README to reflect the new build options x86 => i386
This commit is contained in:
parent
10bf2439d9
commit
1b32fd309b
2 changed files with 8 additions and 9 deletions
10
build.zig
10
build.zig
|
@ -19,12 +19,10 @@ const x86_i686 = CrossTarget{
|
|||
};
|
||||
|
||||
pub fn build(b: *Builder) !void {
|
||||
const arch = b.option([]const u8, "arch", "Architecture to build for: x86") orelse "x86";
|
||||
const target: CrossTarget = if (std.mem.eql(u8, "x86", arch))
|
||||
x86_i686
|
||||
else {
|
||||
std.debug.warn("Unsupported or unknown architecture '{}'\n", .{arch});
|
||||
unreachable;
|
||||
const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 });
|
||||
const arch = switch (target.getCpuArch()) {
|
||||
.i386 => "x86",
|
||||
else => unreachable,
|
||||
};
|
||||
|
||||
const fmt_step = b.addFmt(&[_][]const u8{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue