diff options
| author | 2023-08-04 19:36:06 -0700 | |
|---|---|---|
| committer | 2023-08-05 18:04:40 +0200 | |
| commit | e18bfb92b83739995477f0a1cbf55d2965fa1115 (patch) | |
| tree | a122f14362a249d363e48e2a6e929b1a41e4dd7b | |
| parent | build.zig: register module (diff) | |
| download | zig-sqlite-e18bfb92b83739995477f0a1cbf55d2965fa1115.tar.gz zig-sqlite-e18bfb92b83739995477f0a1cbf55d2965fa1115.tar.xz zig-sqlite-e18bfb92b83739995477f0a1cbf55d2965fa1115.zip | |
build.zig: add sqlite artifact
| -rw-r--r-- | build.zig | 16 |
1 files changed, 16 insertions, 0 deletions
| @@ -187,6 +187,22 @@ pub fn build(b: *std.Build) !void { | |||
| 187 | var sqlite_module = b.createModule(.{ .source_file = .{ .path = "sqlite.zig" } }); | 187 | var sqlite_module = b.createModule(.{ .source_file = .{ .path = "sqlite.zig" } }); |
| 188 | try b.modules.put(b.dupe("sqlite"), sqlite_module); | 188 | try b.modules.put(b.dupe("sqlite"), sqlite_module); |
| 189 | 189 | ||
| 190 | const sqlite_lib = b.addStaticLibrary(.{ | ||
| 191 | .name = "sqlite", | ||
| 192 | .target = target, | ||
| 193 | .optimize = optimize, | ||
| 194 | }); | ||
| 195 | |||
| 196 | sqlite_lib.addIncludePath(.{ .path = "c/" }); | ||
| 197 | sqlite_lib.addCSourceFile(.{ | ||
| 198 | .file = .{ .path = "c/sqlite3.c" }, | ||
| 199 | .flags = &[_][]const u8{"-std=c99"}, | ||
| 200 | }); | ||
| 201 | sqlite_lib.linkLibC(); | ||
| 202 | sqlite_lib.installHeader("c/sqlite3.h", "sqlite3.h"); | ||
| 203 | |||
| 204 | b.installArtifact(sqlite_lib); | ||
| 205 | |||
| 190 | // Tool to preprocess the sqlite header files. | 206 | // Tool to preprocess the sqlite header files. |
| 191 | // | 207 | // |
| 192 | // Due to limitations of translate-c the standard header files can't be used for building loadable extensions | 208 | // Due to limitations of translate-c the standard header files can't be used for building loadable extensions |