summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-04-14 18:06:03 +0200
committerGravatar GitHub2024-04-14 18:06:03 +0200
commitf6308761fcc4b0f96429341302e08e858fc841a5 (patch)
tree4e509a4cdc8e610a839a5c0cfdeb4b69cd625f39
parentMerge pull request #155 from MFAshby/patch-2 (diff)
parentbuild.zig: Configure module to be used downstream (diff)
downloadzig-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.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 24d3be6..70b5b56 100644
--- a/build.zig
+++ b/build.zig
@@ -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