summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-12-08 14:56:17 +0100
committerGravatar Vincent Rischmann2024-12-08 14:56:19 +0100
commit163c82287609b0873fc308b71de2a6d3e7a88eec (patch)
tree32289976198cf44e223293bea2d9f09f19a8bb10
parentMerge branch 'improve-readme-fetch' (diff)
downloadzig-sqlite-163c82287609b0873fc308b71de2a6d3e7a88eec.tar.gz
zig-sqlite-163c82287609b0873fc308b71de2a6d3e7a88eec.tar.xz
zig-sqlite-163c82287609b0873fc308b71de2a6d3e7a88eec.zip
readme: stop supporting using a git submodule
The official package manager works fine enough now that I don't wan't to support this use case myself; if people want to use Git submodules they'll have to figure it out themselves.
Diffstat (limited to '')
-rw-r--r--README.md64
1 files changed, 0 insertions, 64 deletions
diff --git a/README.md b/README.md
index 39273c3..e6de59e 100644
--- a/README.md
+++ b/README.md
@@ -119,70 +119,6 @@ deps.addAllTo(exe);
119 119
120This is the easiest way to add `zig-sqlite` because it uses the bundled source code, avoiding all sorts of linking problems. 120This is the easiest way to add `zig-sqlite` because it uses the bundled source code, avoiding all sorts of linking problems.
121 121
122## Git submodule
123
124If you don't want to use a package manager you can simply add this repository as a git submodule.
125
126Then you need to chose if you want to use the system sqlite library or the bundled source code.
127
128## Using the system sqlite library
129
130If you want to use the system sqlite library, add the following to your `build.zig` target(s):
131
132```zig
133const sqlite = b.addModule("sqlite", .{
134 .root_source_file = b.path("third_party/zig-sqlite/sqlite.zig"),
135});
136sqlite.addCSourceFiles(.{
137 .files = &[_][]const u8{
138 "third_party/zig-sqlite/c/workaround.c",
139 },
140 .flags = &[_][]const u8{"-std=c99"},
141});
142sqlite.addIncludePath(b.path("third_party/sqlite/c"));
143
144exe.linkLibC();
145exe.linkSystemLibrary("sqlite3");
146exe.root_module.addImport("sqlite", sqlite);
147```
148
149## Using the bundled sqlite source code file
150
151If you want to use the bundled sqlite source code file, first you need to add it to the module in your `build.zig` file:
152
153```zig
154const sqlite = b.addModule("sqlite", .{
155 .root_source_file = b.path("third_party/zig-sqlite/sqlite.zig"),
156});
157sqlite.addCSourceFiles(.{
158 .files = &[_][]const u8{
159 "third_party/zig-sqlite/c/sqlite3.c",
160 "third_party/zig-sqlite/c/workaround.c",
161 },
162 .flags = &[_][]const u8{"-std=c99"},
163});
164sqlite.addIncludePath(b.path("third_party/sqlite/c"));
165
166exe.linkLibC();
167exe.root_module.addImport("sqlite", sqlite);
168```
169
170If you need to define custom [compile-time options](https://www.sqlite.org/compile.html#overview) for sqlite, modify the flags (second argument to `addCSourceFiles`).
171
172If you're building with glibc you must make sure that the version used is at least 2.28.
173
174You can do that in your `build.zig` file:
175```zig
176var target = b.standardTargetOptions(.{});
177target.setGnuLibCVersion(2, 28, 0);
178exe.setTarget(target);
179```
180
181Or with `-Dtarget`:
182```
183$ zig build -Dtarget=native-linux-gnu.2.28
184```
185
186# Usage 122# Usage
187 123
188## Demo 124## Demo