Skip to content

Commit

Permalink
Always accept .o and .obj files
Browse files Browse the repository at this point in the history
  • Loading branch information
denizzzka committed Jan 2, 2025
1 parent b2c83e9 commit 2574bbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/dmd.obj_extensions.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Accepting .o and .obj file extensions on all platforms

Accepting .o and .obj file extensions on all platforms makes DMD behave
the same as Clang and other modern compilers. There is no point in
discarding *.o or *.obj depending on the current OS, as both extensions
indicate that this is an object file.
2 changes: 1 addition & 1 deletion compiler/src/dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ bool createModule(const(char)* file, ref Strings libmodules, const ref Target ta

/* Deduce what to do with a file based on its extension
*/
if (FileName.equals(ext, target.obj_ext))
if (FileName.equals(ext, "obj") || FileName.equals(ext, "o"))
{
global.params.objfiles.push(file);
libmodules.push(file);
Expand Down

0 comments on commit 2574bbf

Please sign in to comment.