diff options
| author | 2024-04-14 18:06:03 +0200 | |
|---|---|---|
| committer | 2024-04-14 18:06:03 +0200 | |
| commit | f6308761fcc4b0f96429341302e08e858fc841a5 (patch) | |
| tree | 4e509a4cdc8e610a839a5c0cfdeb4b69cd625f39 | |
| parent | Merge pull request #155 from MFAshby/patch-2 (diff) | |
| parent | build.zig: Configure module to be used downstream (diff) | |
| download | zig-sqlite-f6308761fcc4b0f96429341302e08e858fc841a5.tar.gz zig-sqlite-f6308761fcc4b0f96429341302e08e858fc841a5.tar.xz zig-sqlite-f6308761fcc4b0f96429341302e08e858fc841a5.zip | |
Merge pull request #154 from JacobCrabill/dev/zig-0.12-modules
build.zig: Configure module to be used downstream
| -rw-r--r-- | build.zig | 10 |
1 files changed, 8 insertions, 2 deletions
| @@ -267,8 +267,6 @@ pub fn build(b: *std.Build) !void { | |||
| 267 | const target = b.resolveTargetQuery(query); | 267 | const target = b.resolveTargetQuery(query); |
| 268 | const optimize = b.standardOptimizeOption(.{}); | 268 | const optimize = b.standardOptimizeOption(.{}); |
| 269 | 269 | ||
| 270 | _ = b.addModule("sqlite", .{ .root_source_file = .{ .path = "sqlite.zig" } }); | ||
| 271 | |||
| 272 | const sqlite_lib = b.addStaticLibrary(.{ | 270 | const sqlite_lib = b.addStaticLibrary(.{ |
| 273 | .name = "sqlite", | 271 | .name = "sqlite", |
| 274 | .target = target, | 272 | .target = target, |
| @@ -285,6 +283,14 @@ pub fn build(b: *std.Build) !void { | |||
| 285 | 283 | ||
| 286 | b.installArtifact(sqlite_lib); | 284 | b.installArtifact(sqlite_lib); |
| 287 | 285 | ||
| 286 | // Create the public 'sqlite' module to be exported | ||
| 287 | const sqlite_mod = b.addModule("sqlite", .{ | ||
| 288 | .root_source_file = .{ .path = "sqlite.zig" }, | ||
| 289 | .link_libc = true, | ||
| 290 | }); | ||
| 291 | sqlite_mod.addIncludePath(.{ .path = "c/" }); | ||
| 292 | sqlite_mod.linkLibrary(sqlite_lib); | ||
| 293 | |||
| 288 | // Tool to preprocess the sqlite header files. | 294 | // Tool to preprocess the sqlite header files. |
| 289 | // | 295 | // |
| 290 | // Due to limitations of translate-c the standard header files can't be used for building loadable extensions | 296 | // Due to limitations of translate-c the standard header files can't be used for building loadable extensions |