From d7456b34c8c3141b54f2a7ff9e4d89b7a08f86d3 Mon Sep 17 00:00:00 2001 From: JacobCrabill Date: Mon, 29 Jan 2024 22:07:54 -0800 Subject: build.zig: Configure module to be used downstream --- build.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'build.zig') 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 { const target = b.resolveTargetQuery(query); const optimize = b.standardOptimizeOption(.{}); - _ = b.addModule("sqlite", .{ .root_source_file = .{ .path = "sqlite.zig" } }); - const sqlite_lib = b.addStaticLibrary(.{ .name = "sqlite", .target = target, @@ -285,6 +283,14 @@ pub fn build(b: *std.Build) !void { b.installArtifact(sqlite_lib); + // Create the public 'sqlite' module to be exported + const sqlite_mod = b.addModule("sqlite", .{ + .root_source_file = .{ .path = "sqlite.zig" }, + .link_libc = true, + }); + sqlite_mod.addIncludePath(.{ .path = "c/" }); + sqlite_mod.linkLibrary(sqlite_lib); + // Tool to preprocess the sqlite header files. // // Due to limitations of translate-c the standard header files can't be used for building loadable extensions -- cgit v1.2.3