diff --git a/build.zig b/build.zig index 14bc91256a79ccb7fc1ca4159f415626ae409fd9..a922147bd103ed369818a25f0dbf0adeada53345 100644 --- a/build.zig +++ b/build.zig @@ -4,6 +4,7 @@ const deps = @import("./deps.zig"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; + const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; const exe = b.addExecutable(.{ .name = "zig-color", @@ -12,6 +13,8 @@ pub fn build(b: *std.Build) void { .optimize = mode, }); deps.addAllTo(exe); + exe.use_llvm = !disable_llvm; + exe.use_lld = !disable_llvm; b.installArtifact(exe); const run_cmd = b.addRunArtifact(exe); @@ -31,6 +34,8 @@ pub fn build(b: *std.Build) void { .optimize = mode, }); deps.addAllTo(tests); + tests.use_llvm = !disable_llvm; + tests.use_lld = !disable_llvm; const test_step = b.step("test", "Run all library tests"); const tests_run = b.addRunArtifact(tests);