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 Dec 27, 2024
1 parent b2c83e9 commit ab6606c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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_extensions[0]) || FileName.equals(ext, obj_extensions[1]))
{
global.params.objfiles.push(file);
libmodules.push(file);
Expand Down
6 changes: 4 additions & 2 deletions compiler/src/dmd/target.d
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ void addCppRuntimePredefinedGlobalIdent(const ref TargetCPP cpp)
}
}

package immutable string[] obj_extensions = ["obj", "o"];

////////////////////////////////////////////////////////////////////////////////
/**
* Describes a back-end target. At present it is incomplete, but in the future
Expand Down Expand Up @@ -499,14 +501,14 @@ extern (C++) struct Target

if (os == Target.OS.Windows)
{
obj_ext = "obj";
obj_ext = obj_extensions[0];
lib_ext = "lib";
dll_ext = "dll";
run_noext = false;
}
else if (os & (Target.OS.linux | Target.OS.FreeBSD | Target.OS.OpenBSD | Target.OS.DragonFlyBSD | Target.OS.Solaris | Target.OS.OSX))
{
obj_ext = "o";
obj_ext = obj_extensions[1];

Check warning on line 511 in compiler/src/dmd/target.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/target.d#L511

Added line #L511 was not covered by tests
lib_ext = "a";
if (os == Target.OS.OSX)
dll_ext = "dylib";
Expand Down

0 comments on commit ab6606c

Please sign in to comment.