-
Notifications
You must be signed in to change notification settings - Fork 6
Install
00JCIV00 edited this page Oct 2, 2024
·
2 revisions
- Find the latest
v#.#.#
commit here. - Copy the full SHA for the commit.
- Add the dependency to
build.zig.zon
:
zig fetch --save "https://github.com/00JCIV00/cova/archive/<GIT COMMIT SHA FROM STEP 2 HERE>.tar.gz"
- Add the dependency and module to
build.zig
:
// Cova Dependency
const cova_dep = b.dependency("cova", .{ .target = target, .optimize = optimize });
// Cova Module
const cova_mod = cova_dep.module("cova");
// Executable
const exe = b.addExecutable(.{
.name = "cova_example",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
// Add the Cova Module to the Executable
exe.root_module.addImport("cova", cova_mod);
Note, this method makes Cova easier to update by simply re-running zig fetch --save https://github.com/00JCIV00/cova/archive/[BRANCH].tar.gz
. However, it can lead to non-reproducible builds because the url will always point to the newest commit of the provided branch. Details can be found in this discussion.
- Choose a branch to stay in sync with.
-
main
is the latest stable branch. - The highest
v#.#.#
is the development branch.
- Add the dependency to
build.zig.zon
:
zig fetch --save https://github.com/00JCIV00/cova/archive/[BRANCH FROM STEP 1].tar.gz
- Continue from Step 4 above.
- Use Zig v0.12 for your system. Available here.
- Run the following in whichever directory you'd like to install to:
git clone https://github.com/00JCIV00/cova.git
cd cova
zig build basic-app -Doptimize=ReleaseSafe
- Try it out!
cd bin
./basic-app help
Looking for Cova's API Documentation? Click here!