Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

addWin32ResourceFile

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.

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

File

lib/std/Build/Module.zig:426

Code

pub 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");
}