authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:53:30 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:53:30 -08:00
log3c0a6280db4a55f2779849c56e3dbfd1ac75d6a7
tree25252b39a64ead9a743f2077d1451a5a4b9a4392
parentf0711a7e22d94c87706a83c255e41f1821bdac92

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-license-detect",10 .name = "zig-license-detect",
...@@ -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);
...@@ -29,6 +32,8 @@ pub fn build(b: *std.Build) void {...@@ -29,6 +32,8 @@ pub fn build(b: *std.Build) void {
29 .optimize = mode,32 .optimize = mode,
30 });33 });
31 deps.addAllTo(tests);34 deps.addAllTo(tests);
35 tests.use_llvm = !disable_llvm;
36 tests.use_lld = !disable_llvm;
3237
33 const test_step = b.step("test", "Run all library tests");38 const test_step = b.step("test", "Run all library tests");
34 const tests_run = b.addRunArtifact(tests);39 const tests_run = b.addRunArtifact(tests);