Function addWin32ResourceFile [src]

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.

Prototype

pub fn addWin32ResourceFile(m: *Module, source: RcSourceFile) void

Parameters

m: *Modulesource: RcSourceFile

Source

pub fn addWin32ResourceFile(m: *Module, source: RcSourceFile) void { const b = m.owner; const allocator = b.allocator; 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 = allocator.create(RcSourceFile) catch @panic("OOM"); rc_source_file.* = source.dupe(b); m.link_objects.append(allocator, .{ .win32_resource_file = rc_source_file }) catch @panic("OOM"); }