diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index bca6114..0f4fb32 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -152,15 +152,20 @@ build_platform.compilerVersion = ver; } - // Hack: see #1059 - // When compiling with --arch=x86_mscoff build_platform.architecture is equal to ["x86"] and canFind below is false. - // This hack prevents unnesessary warning 'Failed to apply the selected architecture x86_mscoff. Got ["x86"]'. - // And also makes "x86_mscoff" available as a platform specifier in the package recipe - if (arch_override == "x86_mscoff") - build_platform.architecture ~= arch_override; - if (arch_override.length && !build_platform.architecture.canFind(arch_override)) { - logWarn(`Failed to apply the selected architecture %s. Got %s.`, - arch_override, build_platform.architecture); + // Skip the following check for LDC, emitting a warning if the specified `-arch` + // cmdline option does not lead to the same string being found among + // `build_platform.architecture`, as it's brittle and doesn't work with triples. + if (build_platform.compiler != "ldc") { + // Hack: see #1059 + // When compiling with --arch=x86_mscoff build_platform.architecture is equal to ["x86"] and canFind below is false. + // This hack prevents unnesessary warning 'Failed to apply the selected architecture x86_mscoff. Got ["x86"]'. + // And also makes "x86_mscoff" available as a platform specifier in the package recipe + if (arch_override == "x86_mscoff") + build_platform.architecture ~= arch_override; + if (arch_override.length && !build_platform.architecture.canFind(arch_override)) { + logWarn(`Failed to apply the selected architecture %s. Got %s.`, + arch_override, build_platform.architecture); + } } return build_platform;