authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2023-09-06 02:26:48-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2023-09-17 03:09:45-07:00
loga94d830a48ce82ea3fdf29c6c604f0972f095e61
treef24f1daec35af2c6b39617bdcf6ffea7e5eda6af
parent73f581b7bcba00176b37247c6701b056e23c651b

addWin32ResourceFile: Ignore the resource file if the target object format is not coff


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/Build/Step/Compile.zig+4
...@@ -932,6 +932,10 @@ pub fn addCSourceFile(self: *Compile, source: CSourceFile) void {...@@ -932,6 +932,10 @@ pub fn addCSourceFile(self: *Compile, source: CSourceFile) void {
932}932}
933933
934pub fn addWin32ResourceFile(self: *Compile, source: RcSourceFile) void {934pub fn addWin32ResourceFile(self: *Compile, source: RcSourceFile) void {
935 // Only the PE/COFF format has a Resource Table, so for any other target
936 // the resource file is just ignored.
937 if (self.target.getObjectFormat() != .coff) return;
938
935 const b = self.step.owner;939 const b = self.step.owner;
936 const rc_source_file = b.allocator.create(RcSourceFile) catch @panic("OOM");940 const rc_source_file = b.allocator.create(RcSourceFile) catch @panic("OOM");
937 rc_source_file.* = source.dupe(b);941 rc_source_file.* = source.dupe(b);