From 601df42c3a9a9cf4a6b76435293706a90a782fe2 Mon Sep 17 00:00:00 2001 From: Kitty-Cricket Piapiac Date: Fri, 4 Aug 2023 20:34:17 -0700 Subject: README.md: official package manager --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 993232c..eaaf626 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,33 @@ For sqlite, you have options depending on your target: # Installation -There are two primary ways to include `zig-sqlite` in your project: +There are three main ways to include `zig-sqlite` in your project: +* using zig's official package manager * using the [zigmod](https://github.com/nektro/zigmod) package manager * using a git submodule +## Official package manager + +Add this as one of the `.dependencies` inside your `build.zig.zon` file: +```zig +.sqlite = .{ + .url = "https://github.com/vrischmann/zig-sqlite/archive/COMMIT.tar.gz", +}, +``` + +Now in your `build.zig` you can access the module like this: +```zig +const sqlite = b.dependency("sqlite", .{ + .target = target, + .optimize = optimize, +}); + +exe.addModule("sqlite", sqlite.module("sqlite")); + +// links the bundled sqlite3, so leave this out if you link the system one +exe.linkLibrary(sqlite.artifact("sqlite")); +``` + ## zigmod Add this to your `zig.mod` file: -- cgit v1.2.3