authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:50:49 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:50:49 -08:00
logf2dded3e3139c72a3787adca3aed13eeaedd98e4
tree3fd97536e21beaf0691cc3c8661999986ed4abe3
parent49120131201e6aeaa62720a8b06bd5357ff7d82f

add disable_llvm build param


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

build.zig+7
...@@ -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-licenses",10 .name = "zig-licenses",
...@@ -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);
...@@ -32,6 +35,8 @@ pub fn build(b: *std.Build) void {...@@ -32,6 +35,8 @@ pub fn build(b: *std.Build) void {
32 .optimize = mode,35 .optimize = mode,
33 });36 });
34 deps.addAllTo(exe2);37 deps.addAllTo(exe2);
38 exe2.use_llvm = !disable_llvm;
39 exe2.use_lld = !disable_llvm;
35 b.installArtifact(exe2);40 b.installArtifact(exe2);
3641
37 const run_cmd2 = b.addRunArtifact(exe2);42 const run_cmd2 = b.addRunArtifact(exe2);
...@@ -49,6 +54,8 @@ pub fn build(b: *std.Build) void {...@@ -49,6 +54,8 @@ pub fn build(b: *std.Build) void {
49 .optimize = mode,54 .optimize = mode,
50 });55 });
51 deps.addAllTo(tests);56 deps.addAllTo(tests);
57 tests.use_llvm = !disable_llvm;
58 tests.use_lld = !disable_llvm;
5259
53 const test_step = b.step("test", "Run all library tests");60 const test_step = b.step("test", "Run all library tests");
54 const tests_run = b.addRunArtifact(tests);61 const tests_run = b.addRunArtifact(tests);