diff options
| author | 2024-01-29 22:07:54 -0800 | |
|---|---|---|
| committer | 2024-01-29 22:07:54 -0800 | |
| commit | d7456b34c8c3141b54f2a7ff9e4d89b7a08f86d3 (patch) | |
| tree | e25810d4c056cc84d8d7a42ad4a07b5d41b88a70 | |
| parent | Merge pull request #152 from jiacai2050/master (diff) | |
| download | zig-sqlite-d7456b34c8c3141b54f2a7ff9e4d89b7a08f86d3.tar.gz zig-sqlite-d7456b34c8c3141b54f2a7ff9e4d89b7a08f86d3.tar.xz zig-sqlite-d7456b34c8c3141b54f2a7ff9e4d89b7a08f86d3.zip | |
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 |