mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-16 02:10:13 +02:00
work around zig json bug
This commit is contained in:
parent
64b8b9e715
commit
3cd8cdb2ce
|
@ -17,7 +17,9 @@ pub fn confgenGet(comptime T: type, root_path: []const u8, alloc: std.mem.Alloca
|
||||||
.init(alloc, buf_reader.reader());
|
.init(alloc, buf_reader.reader());
|
||||||
defer reader.deinit();
|
defer reader.deinit();
|
||||||
|
|
||||||
|
const ret = try std.json.parseFromTokenSource(T, alloc, &reader, confgen_json_opt);
|
||||||
|
|
||||||
// We just grab the value from the parse result as this data will almost certainly have been
|
// We just grab the value from the parse result as this data will almost certainly have been
|
||||||
// allocated with the builder's arena anyways.
|
// allocated with the builder's arena anyways.
|
||||||
return (try std.json.parseFromTokenSource(T, alloc, &reader, confgen_json_opt)).value;
|
return ret.value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn build(b: *std.build.Builder) !void {
|
||||||
const znvim_dep = b.dependency("znvim", .{ .target = target, .optimize = mode });
|
const znvim_dep = b.dependency("znvim", .{ .target = target, .optimize = mode });
|
||||||
|
|
||||||
const cg_opt = try common.confgenGet(struct {
|
const cg_opt = try common.confgenGet(struct {
|
||||||
term_font: []const u8,
|
term_font: []u8, // TODO: this being non-const is a workaround for an std bug
|
||||||
}, "..", b.allocator);
|
}, "..", b.allocator);
|
||||||
|
|
||||||
const opts = b.addOptions();
|
const opts = b.addOptions();
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub fn build(b: *std.build.Builder) !void {
|
||||||
exe.addModule("ansi-term", b.dependency("ansi_term", .{}).module("ansi-term"));
|
exe.addModule("ansi-term", b.dependency("ansi_term", .{}).module("ansi-term"));
|
||||||
|
|
||||||
const cg_opt = try common.confgenGet(struct {
|
const cg_opt = try common.confgenGet(struct {
|
||||||
gtk_theme: []const u8,
|
gtk_theme: []u8, // TODO: this being non-const is a workaround for an std bug
|
||||||
}, "../..", b.allocator);
|
}, "../..", b.allocator);
|
||||||
|
|
||||||
const opts = b.addOptions();
|
const opts = b.addOptions();
|
||||||
|
|
Loading…
Reference in a new issue