diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index 10951b1..2eec2a3 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -80,10 +80,15 @@ { string[] arch_flags; switch (arch_override) { - default: throw new Exception("Unsupported architecture: "~arch_override); case "": break; case "x86": arch_flags = ["-march=x86"]; break; case "x86_64": arch_flags = ["-march=x86-64"]; break; + default: + if (arch_override.canFind('-')) + arch_flags = ["-mtriple="~arch_override]; + else + throw new Exception("Unsupported architecture: "~arch_override); + break; } settings.addDFlags(arch_flags); @@ -176,6 +181,8 @@ case TargetType.executable: if (platform.platform.canFind("windows")) return settings.targetName ~ ".exe"; + else if (platform.platform.canFind("wasm")) + return settings.targetName ~ ".wasm"; else return settings.targetName; case TargetType.library: case TargetType.staticLibrary: diff --git a/source/dub/platform.d b/source/dub/platform.d index 88da7b2..0c27199 100644 --- a/source/dub/platform.d +++ b/source/dub/platform.d @@ -42,6 +42,7 @@ version(Android) ret ~= "android"; version(Cygwin) ret ~= "cygwin"; version(MinGW) ret ~= "mingw"; + version(WebAssembly) ret ~= "wasm"; return ret; };