diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index 4880e3e..dafa331 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -377,22 +377,18 @@ fil.write(q{ template toString(int v) { enum toString = v.stringof; } - void main() - { - pragma(msg, `{`); - pragma(msg,` "compiler": "`~ determineCompiler() ~ `",`); - pragma(msg, ` "frontendVersion": ` ~ toString!__VERSION__ ~ `,`); - pragma(msg, ` "compilerVendor": "` ~ __VENDOR__ ~ `",`); - pragma(msg, ` "platform": [`); - pragma(msg, ` ` ~ determinePlatform()); - pragma(msg, ` ],`); - pragma(msg, ` "architecture": [`); - pragma(msg, ` ` ~ determineArchitecture()); - pragma(msg, ` ],`); - pragma(msg, `}`); - } - - + pragma(msg, `{`); + pragma(msg,` "compiler": "`~ determineCompiler() ~ `",`); + pragma(msg, ` "frontendVersion": ` ~ toString!__VERSION__ ~ `,`); + pragma(msg, ` "compilerVendor": "` ~ __VENDOR__ ~ `",`); + pragma(msg, ` "platform": [`); + pragma(msg, ` ` ~ determinePlatform()); + pragma(msg, ` ],`); + pragma(msg, ` "architecture": [`); + pragma(msg, ` ` ~ determineArchitecture()); + pragma(msg, ` ],`); + pragma(msg, `}`); + string determinePlatform() { string ret; diff --git a/source/dub/compilers/gdc.d b/source/dub/compilers/gdc.d index 5920175..e31053f 100644 --- a/source/dub/compilers/gdc.d +++ b/source/dub/compilers/gdc.d @@ -67,7 +67,7 @@ } settings.addDFlags(arch_flags); - auto result = executeShell(escapeShellCommand(compiler_binary ~ arch_flags ~ ["-c", fil.toNativeString()])); + auto result = executeShell(escapeShellCommand(compiler_binary ~ arch_flags ~ ["-c", "-o", (getTempDir()~"dub_platform_probe").toNativeString(), fil.toNativeString()])); enforce(result.status == 0, format("Failed to invoke the compiler %s to determine the build platform: %s", compiler_binary, result.output)); diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index 570bc8b..7a880f5 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -297,7 +297,7 @@ return format("%s-%s-%s-%s-%s-%s", config, settings.buildType, settings.platform.platform.join("."), settings.platform.architecture.join("."), - settings.platform.compilerBinary, hashstr); + settings.platform.compiler, hashstr); } private void copyTargetFile(Path build_path, BuildSettings buildsettings, BuildPlatform platform) diff --git a/source/dub/platform.d b/source/dub/platform.d index b100755..acc9baf 100644 --- a/source/dub/platform.d +++ b/source/dub/platform.d @@ -81,7 +81,7 @@ { version(DigitalMars) return "dmd"; else version(GNU) return "gdc"; - else version(LDC) return "ldc"; + else version(LDC) return "ldc2"; else version(SDC) return "sdc"; else return null; }