authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-21 00:29:33 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-21 00:29:33 -08:00
log7d475aab88647fc334988d27b3458f09d5c69710
tree9ea792f249cd15ef55d8747501c48373d73a5bd8
parent700d78435055209fcd91a1af094182f5a63ae235

add build.zig option for ziginfra


1 files changed, 3 insertions(+), 0 deletions(-)

build.zig+3
...@@ -4,6 +4,7 @@ const deps = @import("./deps.zig");...@@ -4,6 +4,7 @@ const deps = @import("./deps.zig");
4pub fn build(b: *std.Build) void {4pub fn build(b: *std.Build) void {
5 const target = b.standardTargetOptions(.{});5 const target = b.standardTargetOptions(.{});
6 const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;6 const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
7 const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false;
78
8 const tests = b.addTest(.{9 const tests = b.addTest(.{
9 .root_source_file = b.path("test.zig"),10 .root_source_file = b.path("test.zig"),
...@@ -11,6 +12,8 @@ pub fn build(b: *std.Build) void {...@@ -11,6 +12,8 @@ pub fn build(b: *std.Build) void {
11 .optimize = mode,12 .optimize = mode,
12 });13 });
13 deps.addAllTo(tests);14 deps.addAllTo(tests);
15 tests.use_llvm = !disable_llvm;
16 tests.use_lld = !disable_llvm;
1417
15 const test_step = b.step("test", "Run all library tests");18 const test_step = b.step("test", "Run all library tests");
16 const tests_run = b.addRunArtifact(tests);19 const tests_run = b.addRunArtifact(tests);