authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:53:24 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:53:24 -08:00
log6af6b871d79fb32cd4960dcdabb7a36a94c7e1cd
treeb424dcfaf52afd1fae49209253b73836ae64ff55
parent3b2ab7f68a85fadcb5c1b8c1048c461034dc3e29

add disable_llvm build param


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

build.zig+5
...@@ -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 exe = b.addExecutable(.{9 const exe = b.addExecutable(.{
9 .name = "zig-color",10 .name = "zig-color",
...@@ -12,6 +13,8 @@ pub fn build(b: *std.Build) void {...@@ -12,6 +13,8 @@ pub fn build(b: *std.Build) void {
12 .optimize = mode,13 .optimize = mode,
13 });14 });
14 deps.addAllTo(exe);15 deps.addAllTo(exe);
16 exe.use_llvm = !disable_llvm;
17 exe.use_lld = !disable_llvm;
15 b.installArtifact(exe);18 b.installArtifact(exe);
1619
17 const run_cmd = b.addRunArtifact(exe);20 const run_cmd = b.addRunArtifact(exe);
...@@ -31,6 +34,8 @@ pub fn build(b: *std.Build) void {...@@ -31,6 +34,8 @@ pub fn build(b: *std.Build) void {
31 .optimize = mode,34 .optimize = mode,
32 });35 });
33 deps.addAllTo(tests);36 deps.addAllTo(tests);
37 tests.use_llvm = !disable_llvm;
38 tests.use_lld = !disable_llvm;
3439
35 const test_step = b.step("test", "Run all library tests");40 const test_step = b.step("test", "Run all library tests");
36 const tests_run = b.addRunArtifact(tests);41 const tests_run = b.addRunArtifact(tests);