diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index 289d611..84e0a8e 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -245,7 +245,8 @@ auto args = ["-of"~tpath.toNativeString()]; args ~= objects; args ~= settings.sourceFiles; - version(linux) args ~= "-L--no-as-needed"; // avoids linker errors due to libraries being specified in the wrong order + if (platform.platform.canFind("linux")) + args ~= "-L--no-as-needed"; // avoids linker errors due to libraries being specified in the wrong order args ~= lflagsToDFlags(settings.lflags); args ~= settings.dflags.filter!(f => isLinkerDFlag(f)).array;