Skip to content

Commit

Permalink
Merge pull request #4 from robguthrie/patch-1
Browse files Browse the repository at this point in the history
Update readme.md
  • Loading branch information
karlseguin authored Apr 24, 2024
2 parents 5f0379e + 76b8fd8 commit 2415644
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,21 @@ Add into `dependencies` of `build.zig.zon`:
},
```

The library doesn't attempt to link/include SQLite. You're free to do this how you want. If you download the SQLite amalgamation from [the SQLite download page](https://www.sqlite.org/download.html) and place the `sqlite.c` and `sqlite.h` file in your project's `lib/sqlite3/` folder, you can then:
The library doesn't attempt to link/include SQLite. You're free to do this how you want.

If you have sqlite3 installed on your system you might get away with just adding this to your build.zig

```zig
const zqlite = b.dependency("zqlite", .{
.target = target,
.optimize = optimize,
});
exe.linkSystemLibrary("sqlite3");
exe.root_module.addImport("zqlite", zqlite.module("zqlite"));
```

Alternatively, If you download the SQLite amalgamation from [the SQLite download page](https://www.sqlite.org/download.html) and place the `sqlite.c` and `sqlite.h` file in your project's `lib/sqlite3/` folder, you can then:

2) Add this in `build.zig`:
```zig
Expand Down Expand Up @@ -73,7 +87,7 @@ zqlite.addCSourceFile(.{
},
});
zqlite.addIncludePath(LazyPath.relative("lib/sqlite3/"));
exe.root_module.addImport("zqlite", zqlite);
exe.root_module.addImport("zqlite", zqlite.module("zqlite"));
```

You can tweak the SQLite build flags for your own needs/platform.
Expand Down

0 comments on commit 2415644

Please sign in to comment.