Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4436,7 +4436,7 @@ pub fn addCCArgs(
try argv.append("-fno-unwind-tables");
}
},
.shared_library, .ll, .bc, .unknown, .static_library, .object, .def, .zig => {},
.shared_library, .ll, .bc, .unknown, .static_library, .object, .def, .zig, .res => {},
.assembly, .assembly_with_cpp => {
// The Clang assembler does not accept the list of CPU features like the
// compiler frontend does. Therefore we must hard-code the -m flags for
Expand Down Expand Up @@ -4602,6 +4602,7 @@ pub const FileExt = enum {
static_library,
zig,
def,
res,
unknown,

pub fn clangSupportsDepFile(ext: FileExt) bool {
Expand All @@ -4617,6 +4618,7 @@ pub const FileExt = enum {
.static_library,
.zig,
.def,
.res,
.unknown,
=> false,
};
Expand All @@ -4639,6 +4641,7 @@ pub const FileExt = enum {
.static_library => target.staticLibSuffix(),
.zig => ".zig",
.def => ".def",
.res => ".res",
.unknown => "",
};
}
Expand Down Expand Up @@ -4730,6 +4733,8 @@ pub fn classifyFileExt(filename: []const u8) FileExt {
return .cu;
} else if (mem.endsWith(u8, filename, ".def")) {
return .def;
} else if (mem.endsWith(u8, filename, ".res")) {
return .res;
} else {
return .unknown;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ fn buildOutputType(
}
} else switch (file_ext orelse
Compilation.classifyFileExt(arg)) {
.object, .static_library, .shared_library => try link_objects.append(.{ .path = arg }),
.object, .static_library, .shared_library, .res => try link_objects.append(.{ .path = arg }),
.assembly, .assembly_with_cpp, .c, .cpp, .h, .ll, .bc, .m, .mm, .cu => {
try c_source_files.append(.{
.src_path = arg,
Expand Down Expand Up @@ -1605,7 +1605,7 @@ fn buildOutputType(
.ext = file_ext, // duped while parsing the args.
});
},
.unknown, .shared_library, .object, .static_library => try link_objects.append(.{
.unknown, .shared_library, .object, .static_library, .res => try link_objects.append(.{
.path = it.only_arg,
.must_link = must_link,
}),
Expand Down