Skip to content

Commit 7c0eae4

Browse files
committed
Added option for setting SQLITE_THREADSAFE
1 parent 0b75ba2 commit 7c0eae4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ pub fn build(b: *std.Build) !void {
169169
try flags.append(b.allocator, flag);
170170
}
171171
}
172+
switch (b.option(u2, "threadsafe", "Set SQLITE_THREADSAFE to 0, 1, or 2") orelse 3) {
173+
0, 1, 2 => |n| {
174+
const flag = try std.fmt.allocPrint(b.allocator, "-DSQLITE_THREADSAFE={d}", .{n});
175+
try flags.append(b.allocator, flag);
176+
},
177+
else => {},
178+
}
172179

173180
const c_flags = flags.items;
174181

0 commit comments

Comments
 (0)