diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 22 |
1 files changed, 21 insertions, 1 deletions
| @@ -13,7 +13,27 @@ fn linkSqlite(b: *std.build.LibExeObjStep) void { | |||
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | pub fn build(b: *std.build.Builder) void { | 15 | pub 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; |