Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

addWin32ResourceFile

Public Function
std.Build.Module.addWin32ResourceFile
pub fn addWin32ResourceFile(m: *Module, source: RcSourceFile) void

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.

Params

File

Build/Module.zig:426
426
427
428
429
430
431
432
433
434
435
436
437
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");
}