From a94d830a48ce82ea3fdf29c6c604f0972f095e61 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Wed, 6 Sep 2023 02:26:48 -0700 Subject: [PATCH] addWin32ResourceFile: Ignore the resource file if the target object format is not coff --- lib/std/Build/Step/Compile.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index f721b52c82..8fcdd6ec05 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -932,6 +932,10 @@ pub fn addCSourceFile(self: *Compile, source: CSourceFile) void { } pub fn addWin32ResourceFile(self: *Compile, source: RcSourceFile) void { + // Only the PE/COFF format has a Resource Table, so for any other target + // the resource file is just ignored. + if (self.target.getObjectFormat() != .coff) return; + const b = self.step.owner; const rc_source_file = b.allocator.create(RcSourceFile) catch @panic("OOM"); rc_source_file.* = source.dupe(b);