diff options
| author | 2023-08-04 20:34:17 -0700 | |
|---|---|---|
| committer | 2023-08-05 18:04:40 +0200 | |
| commit | 601df42c3a9a9cf4a6b76435293706a90a782fe2 (patch) | |
| tree | 8b0ba6bf46f3eb5221162a509d4187a64e8ace94 /README.md | |
| parent | remove gyro.zzz (diff) | |
| download | zig-sqlite-601df42c3a9a9cf4a6b76435293706a90a782fe2.tar.gz zig-sqlite-601df42c3a9a9cf4a6b76435293706a90a782fe2.tar.xz zig-sqlite-601df42c3a9a9cf4a6b76435293706a90a782fe2.zip | |
README.md: official package manager
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 25 |
1 files changed, 24 insertions, 1 deletions
| @@ -71,10 +71,33 @@ For sqlite, you have options depending on your target: | |||
| 71 | 71 | ||
| 72 | # Installation | 72 | # Installation |
| 73 | 73 | ||
| 74 | There are two primary ways to include `zig-sqlite` in your project: | 74 | There are three main ways to include `zig-sqlite` in your project: |
| 75 | * using zig's official package manager | ||
| 75 | * using the [zigmod](https://github.com/nektro/zigmod) package manager | 76 | * using the [zigmod](https://github.com/nektro/zigmod) package manager |
| 76 | * using a git submodule | 77 | * using a git submodule |
| 77 | 78 | ||
| 79 | ## Official package manager | ||
| 80 | |||
| 81 | Add this as one of the `.dependencies` inside your `build.zig.zon` file: | ||
| 82 | ```zig | ||
| 83 | .sqlite = .{ | ||
| 84 | .url = "https://github.com/vrischmann/zig-sqlite/archive/COMMIT.tar.gz", | ||
| 85 | }, | ||
| 86 | ``` | ||
| 87 | |||
| 88 | Now in your `build.zig` you can access the module like this: | ||
| 89 | ```zig | ||
| 90 | const sqlite = b.dependency("sqlite", .{ | ||
| 91 | .target = target, | ||
| 92 | .optimize = optimize, | ||
| 93 | }); | ||
| 94 | |||
| 95 | exe.addModule("sqlite", sqlite.module("sqlite")); | ||
| 96 | |||
| 97 | // links the bundled sqlite3, so leave this out if you link the system one | ||
| 98 | exe.linkLibrary(sqlite.artifact("sqlite")); | ||
| 99 | ``` | ||
| 100 | |||
| 78 | ## zigmod | 101 | ## zigmod |
| 79 | 102 | ||
| 80 | Add this to your `zig.mod` file: | 103 | Add this to your `zig.mod` file: |