A Zig package for compiling Windows resource scripts/manifests into linkable object files.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alex Rønne Petersen b315438c5a
add minimal CI
2026-10-12 20:15:24 +02:00
.forgejo/workflows add minimal CI 2026-10-12 20:15:24 +02:00
example Make resinator a lazy dependency 2026-07-06 18:14:55 -07:00
src Add support for more options 2026-07-06 04:37:07 -07:00
.gitattributes Initial commit 2026-06-30 17:16:18 -07:00
.gitignore Initial commit 2026-06-30 17:16:18 -07:00
build.zig Make resinator a lazy dependency 2026-07-06 18:14:55 -07:00
build.zig.zon update to Zig 0.18.0-dev.1+a6c6412a8 2026-10-02 00:47:59 +02:00
LICENSE Initial commit 2026-06-30 17:16:18 -07:00
README.md readme: no longer wip 2026-10-01 00:26:14 -07:00

RC

A Zig package for compiling Windows resource scripts and manifests into linkable object files.

This is the main branch, which tracks master branch of Zig. Other branches track other versions of Zig.

Usage

Add the rc package to your build.zig.zon with this command:

$ zig fetch --save git+https://codeberg.org/ziglang/rc
info: resolved to commit ...

Then, within your build.zig, write something like this:

const rc = @import("rc");

if (target.result.os.tag == .windows) {
    // This call being inside the `if` means `resinator` will only be fetched when it's used.
    const rc_dep = b.dependency("rc", .{});

    // `Compiler` is the high-level/convenient API. If you want more fine-grained
    // control you can use rc.Win32Resource, rc.Manifest, and rc.CvtRes instead.
    var rc_compiler: rc.Compiler = .init(rc_dep, .{
        .rc_files = &.{b.path("example.rc")},
        .manifest = .{
            .file = b.path("example.manifest"),
            .for_dll = false,
        },
        .target = target,
        .optimize = optimize,
    });

    // All the resources eventually get compiled into an object file
    // that you can add to the relevant module like so:
    some_module.addObjectFile(rc_compiler.getObjectFile());
}

For a more complete usage example, take a look at the example/ directory.