authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:47:08 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-02-15 12:47:08 -08:00
logccb4b629f90e22aba707bbf35b9cc4543fd01041
tree664eeed6a3c2f207421deeddc76e8bdbcd103ed9
parent18fee8113d3f3a195a95e11f507290b3a9203b1a

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 lib = b.addStaticLibrary(.{9 const lib = b.addStaticLibrary(.{
9 .name = "icu",10 .name = "icu",
...@@ -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(lib);15 deps.addAllTo(lib);
16 lib.use_llvm = !disable_llvm;
17 lib.use_lld = !disable_llvm;
15 b.installArtifact(lib);18 b.installArtifact(lib);
1619
17 b.installDirectory(.{20 b.installDirectory(.{
...@@ -26,6 +29,8 @@ pub fn build(b: *std.Build) void {...@@ -26,6 +29,8 @@ pub fn build(b: *std.Build) void {
26 .optimize = mode,29 .optimize = mode,
27 });30 });
28 deps.addAllTo(tests);31 deps.addAllTo(tests);
32 tests.use_llvm = !disable_llvm;
33 tests.use_lld = !disable_llvm;
2934
30 const test_step = b.step("test", "Run all library tests");35 const test_step = b.step("test", "Run all library tests");
31 const tests_run = b.addRunArtifact(tests);36 const tests_run = b.addRunArtifact(tests);