mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 15:28:21 +00:00
all: tidy
This commit is contained in:
+17
-1
@@ -28,8 +28,24 @@ pub const Config = struct {
|
||||
};
|
||||
|
||||
pub fn parseConfig(b: *std.Build) !Config {
|
||||
const gpa = b.allocator;
|
||||
var arena_allocator: std.heap.ArenaAllocator = .init(gpa);
|
||||
defer arena_allocator.deinit();
|
||||
const arena = arena_allocator.allocator();
|
||||
|
||||
var diag: std.zon.parse.Diagnostics = undefined;
|
||||
|
||||
const file = try std.Io.Dir.cwd().readFileAllocOptions(b.graph.io, ".config.zig.zon", b.allocator, std.Io.Limit.unlimited, .@"1", 0);
|
||||
return std.zon.parse.fromSlice(Config, b.allocator, file, null, .{ .ignore_unknown_fields = true });
|
||||
return std.zon.parse.fromSlice(
|
||||
Config,
|
||||
.{
|
||||
.gpa = gpa,
|
||||
.source = file,
|
||||
.arena = arena,
|
||||
.diagnostics = &diag,
|
||||
.ignore_unknown_fields = true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn getPlatform(config: Config) !Platform {
|
||||
|
||||
Reference in New Issue
Block a user