summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2021-03-13 21:48:46 +0100
committerGravatar Vincent Rischmann2021-03-13 21:48:46 +0100
commit6a2db025c66a7f4ab0a6c28a554e45157d26694d (patch)
treef46d1051191d51e6c0614f5fac238d07daf8015a /build.zig
parentadd two dockerfiles to build with debian and fedora (diff)
parentreadme: add a note about minimum glibc version (diff)
downloadzig-sqlite-6a2db025c66a7f4ab0a6c28a554e45157d26694d.tar.gz
zig-sqlite-6a2db025c66a7f4ab0a6c28a554e45157d26694d.tar.xz
zig-sqlite-6a2db025c66a7f4ab0a6c28a554e45157d26694d.zip
Merge branch 'build-glibc'
Diffstat (limited to '')
-rw-r--r--build.zig22
1 files changed, 21 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index 2c958b9..a1af313 100644
--- a/build.zig
+++ b/build.zig
@@ -13,7 +13,27 @@ fn linkSqlite(b: *std.build.LibExeObjStep) void {
13} 13}
14 14
15pub fn build(b: *std.build.Builder) void { 15pub fn build(b: *std.build.Builder) void {
16 const target = b.standardTargetOptions(.{}); 16 const target = blk: {
17 var tmp = b.standardTargetOptions(.{});
18
19 if (tmp.isGnuLibC()) {
20 const min_glibc_version = std.builtin.Version{
21 .major = 2,
22 .minor = 28,
23 .patch = 0,
24 };
25 if (tmp.glibc_version) |ver| {
26 if (ver.order(min_glibc_version) == .lt) {
27 std.debug.panic("sqlite requires glibc version >= 2.28", .{});
28 }
29 } else {
30 tmp.setGnuLibCVersion(2, 28, 0);
31 }
32 }
33
34 break :blk tmp;
35 };
36
17 const mode = b.standardReleaseOptions(); 37 const mode = b.standardReleaseOptions();
18 38
19 const in_memory = b.option(bool, "in_memory", "Should the tests run with sqlite in memory (default true)") orelse true; 39 const in_memory = b.option(bool, "in_memory", "Should the tests run with sqlite in memory (default true)") orelse true;