diff --git a/build.zig b/build.zig index 1c910fa..7946a7e 100644 --- a/build.zig +++ b/build.zig @@ -29,6 +29,12 @@ pub fn build(b: *Builder) !void { // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. const optimize = b.standardOptimizeOption(.{}); + const no_llvm = b.option( + bool, + "no-llvm", + "Disable LLVM", + ) orelse false; + const broken_windows = b.option( bool, "broken-windows", @@ -52,6 +58,7 @@ pub fn build(b: *Builder) !void { .target = target, .optimize = optimize, }); + exe.use_llvm = !no_llvm; const smithy_dep = b.dependency("smithy", .{ // These are the arguments to the dependency. It expects a target and optimization level. .target = target, @@ -103,6 +110,7 @@ pub fn build(b: *Builder) !void { .target = b.host, .optimize = if (b.verbose) .Debug else .ReleaseSafe, }); + cg_exe.use_llvm = !no_llvm; cg_exe.root_module.addImport("smithy", smithy_dep.module("smithy")); var cg_cmd = b.addRunArtifact(cg_exe); cg_cmd.addArg("--models"); @@ -179,6 +187,7 @@ pub fn build(b: *Builder) !void { }); unit_tests.root_module.addImport("smithy", smithy_dep.module("smithy")); unit_tests.step.dependOn(gen_step); + unit_tests.use_llvm = !no_llvm; const run_unit_tests = b.addRunArtifact(unit_tests); run_unit_tests.skip_foreign_checks = true; @@ -200,6 +209,7 @@ pub fn build(b: *Builder) !void { .target = target, .optimize = optimize, }); + smoke_test.use_llvm = !no_llvm; smoke_test.root_module.addImport("smithy", smithy_dep.module("smithy")); smoke_test.step.dependOn(gen_step);