summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig17
1 files changed, 11 insertions, 6 deletions
diff --git a/build.zig b/build.zig
index a1af313..2d6a8dc 100644
--- a/build.zig
+++ b/build.zig
@@ -12,9 +12,9 @@ fn linkSqlite(b: *std.build.LibExeObjStep) void {
12 } 12 }
13} 13}
14 14
15pub fn build(b: *std.build.Builder) void { 15fn getTarget(original_target: std.zig.CrossTarget, bundled: bool) std.zig.CrossTarget {
16 const target = blk: { 16 if (bundled) {
17 var tmp = b.standardTargetOptions(.{}); 17 var tmp = original_target;
18 18
19 if (tmp.isGnuLibC()) { 19 if (tmp.isGnuLibC()) {
20 const min_glibc_version = std.builtin.Version{ 20 const min_glibc_version = std.builtin.Version{
@@ -31,15 +31,20 @@ pub fn build(b: *std.build.Builder) void {
31 } 31 }
32 } 32 }
33 33
34 break :blk tmp; 34 return tmp;
35 }; 35 }
36 36
37 const mode = b.standardReleaseOptions(); 37 return original_target;
38}
38 39
40pub fn build(b: *std.build.Builder) void {
39 const in_memory = b.option(bool, "in_memory", "Should the tests run with sqlite in memory (default true)") orelse true; 41 const in_memory = b.option(bool, "in_memory", "Should the tests run with sqlite in memory (default true)") orelse true;
40 const dbfile = b.option([]const u8, "dbfile", "Always use this database file instead of a temporary one"); 42 const dbfile = b.option([]const u8, "dbfile", "Always use this database file instead of a temporary one");
41 const use_bundled = b.option(bool, "use_bundled", "Use the bundled sqlite3 source instead of linking the system library (default false)") orelse false; 43 const use_bundled = b.option(bool, "use_bundled", "Use the bundled sqlite3 source instead of linking the system library (default false)") orelse false;
42 44
45 const target = getTarget(b.standardTargetOptions(.{}), use_bundled);
46 const mode = b.standardReleaseOptions();
47
43 // Build sqlite from source if asked 48 // Build sqlite from source if asked
44 if (use_bundled) { 49 if (use_bundled) {
45 const lib = b.addStaticLibrary("sqlite", null); 50 const lib = b.addStaticLibrary("sqlite", null);