| ... | ... | @@ -3,13 +3,15 @@ const deps = @import("./deps.zig"); |
| 3 | 3 | |
| 4 | 4 | pub fn build(b: *std.Build) void { |
| 5 | 5 | const target = b.standardTargetOptions(.{}); |
| 6 | | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 6 | const mode = b.option(std.builtin.OptimizeMode, "mode", "") orelse .Debug; |
| 7 | 7 | const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; |
| 8 | 8 | |
| 9 | 9 | const tests = b.addTest(.{ |
| 10 | | .root_source_file = b.path("test.zig"), |
| 11 | | .target = target, |
| 12 | | .optimize = mode, |
| 10 | .root_module = b.createModule(.{ |
| 11 | .root_source_file = b.path("test.zig"), |
| 12 | .target = target, |
| 13 | .optimize = mode, |
| 14 | }), |
| 13 | 15 | }); |
| 14 | 16 | deps.addAllTo(tests); |
| 15 | 17 | tests.use_llvm = !disable_llvm; |
| ... | ... | @@ -42,11 +44,14 @@ pub fn build(b: *std.Build) void { |
| 42 | 44 | } |
| 43 | 45 | |
| 44 | 46 | fn addFuzzer(b: *std.Build, target: std.Build.ResolvedTarget, comptime name: []const u8, afl_clang_args: []const []const u8) *std.Build.Step.InstallFile { |
| 45 | | const fuzz_lib = b.addStaticLibrary(.{ |
| 47 | const fuzz_lib = b.addLibrary(.{ |
| 48 | .linkage = .static, |
| 46 | 49 | .name = "fuzz-" ++ name ++ "-lib", |
| 47 | | .root_source_file = b.path("fuzz/main.zig"), |
| 48 | | .target = target, |
| 49 | | .optimize = .Debug, |
| 50 | .root_module = b.createModule(.{ |
| 51 | .root_source_file = b.path("fuzz/main.zig"), |
| 52 | .target = target, |
| 53 | .optimize = .Debug, |
| 54 | }), |
| 50 | 55 | }); |
| 51 | 56 | fuzz_lib.want_lto = true; |
| 52 | 57 | fuzz_lib.bundle_compiler_rt = true; |