pub fn addWin32ResourceFile(m: *Module, source: RcSourceFile) void m: *Modulesource: RcSourceFile426
427
428
429
430
431
432
433
434
435
436
437pub fn addWin32ResourceFile(m: *Module, source: RcSourceFile) void {
const graph = m.owner.graph;
const arena = graph.arena;
const target = m.requireKnownTarget();
// Only the PE/COFF format has a Resource Table, so for any other target
// the resource file is ignored.
if (target.ofmt != .coff) return;
const rc_source_file = arena.create(RcSourceFile) catch @panic("OOM");
rc_source_file.* = source.dupe(graph);
m.link_objects.append(arena, .{ .win32_resource_file = rc_source_file }) catch @panic("OOM");
}
Deprecated. This functionality will be moved to an external package: https://codeberg.org/ziglang/rc
Resource files must have the extension
.rc. Can be called regardless of target. The .rc file will be ignored if the target object format does not support embedded resources.