Some more build fixes
Some checks failed
CI / Build mode (push) Has been cancelled
CI / Build mode -Drelease-fast (push) Has been cancelled
CI / Build mode -Drelease-safe (push) Has been cancelled
CI / Build mode -Drelease-small (push) Has been cancelled

This commit is contained in:
Imbus 2024-08-08 15:45:52 +02:00
parent 8da54fdb78
commit 9bf2f4d8a0

View file

@ -5,7 +5,7 @@ const rt = @import("test/runtime_test.zig");
const RuntimeStep = rt.RuntimeStep; const RuntimeStep = rt.RuntimeStep;
const Allocator = std.mem.Allocator; const Allocator = std.mem.Allocator;
// const Builder = std.build.Builder; // const Builder = std.build.Builder;
const Step = std.build.Step; const Step = std.Build.Step;
const Target = std.Target; const Target = std.Target;
const CrossTarget = std.Target.Query; const CrossTarget = std.Target.Query;
const fs = std.fs; const fs = std.fs;
@ -23,16 +23,13 @@ const x86_i686 = CrossTarget{
pub fn build(b: *std.Build) !void { pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 }); const target = b.standardTargetOptions(.{ .whitelist = &[_]CrossTarget{x86_i686}, .default_target = x86_i686 });
const arch = switch (target.getCpuArch()) { const arch = switch (target.query.cpu_arch.?) {
.i386 => "x86", .x86 => "x86",
else => unreachable, else => unreachable,
}; };
const fmt_step = b.addFmt(&[_][]const u8{ const fmt_step = b.addFmt(Step.Fmt.Options{
"build.zig", .paths = &[_][]const u8{ "build.zig", "mkfat32.zig", "src", "test" },
"mkfat32.zig",
"src",
"test",
}); });
b.default_step.dependOn(&fmt_step.step); 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 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 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 "; comptime var test_mode_desc: []const u8 = "\n ";
inline for (@typeInfo(TestMode).Enum.fields) |field| { inline for (@typeInfo(TestMode).Enum.fields) |field| {
const tm = @field(TestMode, field.name); const tm = @field(TestMode, field.name);