Skip to content

Installation

Kauê 地球の土星人 edited this page Sep 6, 2023 · 1 revision

Zilliam can be added to your project using the new Zig package manager. If you want a more general guide, you can find it here.

First, you need to add Zilliam to your build.zig.zon dependencies, it should look something like this:

.{
    .name = "ui-toolkit",
    .version = "0.0.0",
    .dependencies = .{
        .zilliam = .{
           .url = "https://github.com/ymndoseijin/zilliam/archive/$COMMITHERE.tar.gz",
        },
    },
}

You should add the commit hash before the .tar.gz file suffix, if you want to find that, check the (commits)[https://github.com/ymndoseijin/zilliam/commits/main] and click on the commit you want to use and then copy the commit hash from the URL. image

After running zig build again with Zilliam in your build.zig.zon, the compiler will error out and provide you with the hash of tar.gz file in question, which when you copy it and add to the file it will look something like this:

.{
    .name = "ui-toolkit",
    .version = "0.0.0",
    .dependencies = .{
        .zilliam = .{
           .url = "https://github.com/ymndoseijin/zilliam/archive/$COMMITHERE.tar.gz",
           .hash = "$HASHHERE",
        },
    },
}

Now you can add Zilliam to your build.zig by adding this to your build function:

const zilliam_dep = b.dependency("zilliam", .{
    .target = target,
    .optimize = optimize,
});

exe.addModule("zilliam", zilliam_dep.module("zilliam"));

You can now use Zilliam as a module in your project simply by importing it like normal.

const zilliam = @import("zilliam");
Clone this wiki locally