| 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); |
| 3 | |
| 4 | pub fn build(b: *std.Build) void { |
| 5 | const target = b.standardTargetOptions(.{}); |
| 6 | const optimize = b.standardOptimizeOption(.{}); |
| 7 | |
| 8 | if (builtin.os.tag == .windows) return; // TODO: libfuzzer support for windows |
| 9 | if (builtin.os.tag == .openbsd) return; // https://codeberg.org/ziglang/zig/issues/30728 |
| 10 | |
| 11 | const run_step = b.step("run", "Run executables"); |
| 12 | const exe = b.addExecutable(.{ |
| 13 | .name = "main", |
| 14 | .root_module = b.createModule(.{ |
| 15 | .root_source_file = b.path("main.zig"), |
| 16 | .target = target, |
| 17 | .optimize = optimize, |
| 18 | .fuzz = true, |
| 19 | }), |
| 20 | .use_llvm = true, // #23423 |
| 21 | }); |
| 22 | |
| 23 | b.installArtifact(exe); |
| 24 | b.default_step = run_step; |
| 25 | |
| 26 | const run_artifact = b.addRunArtifact(exe); |
| 27 | run_artifact.addFileArg(.cache_root); |
| 28 | run_step.dependOn(&run_artifact.step); |
| 29 | } |