From 9bf2f4d8a02bcf4fc9be625bedef51069432e6ce Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 8 Aug 2024 15:45:52 +0200 Subject: [PATCH] Some more build fixes --- build.zig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index b744903..35da528 100644 --- a/build.zig +++ b/build.zig @@ -5,7 +5,7 @@ const rt = @import("test/runtime_test.zig"); const RuntimeStep = rt.RuntimeStep; const Allocator = std.mem.Allocator; // const Builder = std.build.Builder; -const Step = std.build.Step; +const Step = std.Build.Step; const Target = std.Target; const CrossTarget = std.Target.Query; const fs = std.fs; @@ -23,16 +23,13 @@ const x86_i686 = CrossTarget{ pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 }); - const arch = switch (target.getCpuArch()) { - .i386 => "x86", + const arch = switch (target.query.cpu_arch.?) { + .x86 => "x86", else => unreachable, }; - const fmt_step = b.addFmt(&[_][]const u8{ - "build.zig", - "mkfat32.zig", - "src", - "test", + const fmt_step = b.addFmt(Step.Fmt.Options{ + .paths = &[_][]const u8{ "build.zig", "mkfat32.zig", "src", "test" }, }); b.default_step.dependOn(&fmt_step.step); @@ -47,7 +44,7 @@ pub fn build(b: *std.Build) !void { const fat32_image_path = try fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "fat32.img" }); const test_fat32_image_path = try fs.path.join(b.allocator, &[_][]const u8{ "test", "fat32", "test_fat32.img" }); - const build_mode = b.standardReleaseOptions(); + const build_mode = b.standardOptimizeOption(.{}); comptime var test_mode_desc: []const u8 = "\n "; inline for (@typeInfo(TestMode).Enum.fields) |field| { const tm = @field(TestMode, field.name);