Skip to content

Commit

Permalink
[WIP] Fix issue 618.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Apr 1, 2016
1 parent fedeb66 commit 87f46ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/dub/compilers/ldc.d
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ class LdcCompiler : Compiler {
string getTargetFileName(in BuildSettings settings, in BuildPlatform platform)
const {
assert(settings.targetName.length > 0, "No target name set.");

auto output = run(platform.compilerBinary, "-version");
bool generates_coff = output.byLine.find!(l => l.strip.toLower.startsWith("default target:")).front.canFind("-windows-msvc");

final switch (settings.targetType) {
case TargetType.autodetect: assert(false, "Configurations must have a concrete target type.");
case TargetType.none: return null;
Expand All @@ -163,9 +167,8 @@ class LdcCompiler : Compiler {
else return settings.targetName;
case TargetType.library:
case TargetType.staticLibrary:
/*if (m_generatesCOFF)
return settings.targetName ~ ".lib";
else*/ return "lib" ~ settings.targetName ~ ".a";
if (generates_coff) return settings.targetName ~ ".lib";
else return "lib" ~ settings.targetName ~ ".a";
case TargetType.dynamicLibrary:
if (platform.platform.canFind("windows"))
return settings.targetName ~ ".dll";
Expand Down

0 comments on commit 87f46ca

Please sign in to comment.