From 2b0a7c5cd4d884bd501f7bd33b81c249cb5938e3 Mon Sep 17 00:00:00 2001 From: Evan Haas Date: Sun, 18 Feb 2024 10:18:37 -0800 Subject: [PATCH 1/2] build: set fuzz target query ofmt to --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 3011e8ec..3e96401b 100644 --- a/build.zig +++ b/build.zig @@ -13,6 +13,7 @@ fn addFuzzStep(b: *Build, target: std.Build.ResolvedTarget, afl_clang_lto_path: const fuzz_step = b.step("fuzz", "Build executable for fuzz testing."); var fuzz_target = target; fuzz_target.result.ofmt = .c; + fuzz_target.query.ofmt = .c; const lib_dir_step = try ZigLibDirStep.create(b); From d804e1ee11748428f09f4f31d017f977d1c34fc5 Mon Sep 17 00:00:00 2001 From: Evan Haas Date: Sun, 18 Feb 2024 13:45:20 -0800 Subject: [PATCH 2/2] Update build.zig Co-authored-by: Veikka Tuominen --- build.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 3e96401b..60f6fe4d 100644 --- a/build.zig +++ b/build.zig @@ -11,9 +11,11 @@ const aro_version = std.SemanticVersion{ fn addFuzzStep(b: *Build, target: std.Build.ResolvedTarget, afl_clang_lto_path: []const u8, aro_module: *std.Build.Module) !void { const fuzz_step = b.step("fuzz", "Build executable for fuzz testing."); - var fuzz_target = target; - fuzz_target.result.ofmt = .c; - fuzz_target.query.ofmt = .c; + const fuzz_target = blk: { + var query = target.query; + query.ofmt = .c; + break :blk b.resolveTargetQuery(query); + }; const lib_dir_step = try ZigLibDirStep.create(b);