const std = @import("std"); const Options = @import("Options.zig"); pub fn App(comptime options: Options) type { var names: [options.globals.len][]const u8 = undefined; var types: [options.globals.len]type = undefined; var attrs: [options.globals.len]std.builtin.Type.StructField.Attributes = undefined; for (options.globals, 0..) |field, index| { names[index] = field.name; types[index] = field.type; attrs[index] = .{}; } const G = @Struct(.auto, null, &names, &types, &attrs); return struct { globals: G = g: { var gl: G = undefined; for (options.globals, 1..) |field, id| { @field(gl, field.name) = @ptrFromInt(id); } break :g gl; }, pub const init: @This() = .{}; comptime { for (options.components) |component| { component.exportLinks(); } } }; }