Well i tried to change some of the suggested things, but i didn’t manage to get it working. Nonetheless i thank you all again for taking your time trying to help me
After playing with it some, I realized I misread your original message. My bad. I apologize for that.
This is the guts of my minimal build.zig implementation:
// setup, loops, file reading, populating "names" variable
// ...
var src: std.ArrayList(u8) = .empty;
try src.appendSlice(b.allocator,
\\pub const Icons = struct {
\\
);
for (names.items) |name| {
try src.appendSlice(b.allocator, b.fmt(" @\"{s}\": []const u8,\n", .{name}));
}
try src.appendSlice(b.allocator,
\\};
\\
\\pub const icons: Icons = blk: {
\\ var f: Icons = undefined;
\\ for (@typeInfo(Icons).@"struct".fields) |field| {
\\ @field(f, field.name) = @embedFile(field.name ++ ".tvg");
\\ }
\\ break :blk f;
\\};
\\
);
...
I can post it on a gist if you are interested.
(I do stand behind my other comments on the thread.)