Skip to content

Commit 44972b0

Browse files
committed
fix the oldnames lib problem when you have Visual Studio installed and try to use dmd out of the box
1 parent 6fdde39 commit 44972b0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

compiler/src/dmd/vsoptions.d

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,14 @@ public:
225225
}
226226
}
227227

228-
version (IN_LLVM) {} else
229-
{
230-
// try mingw fallback relative to phobos library folder that's part of LIB
228+
return null;
229+
}
230+
231+
const(char)* getBuiltinLibPath() const
232+
{
233+
version (IN_LLVM)
231234
if (auto p = FileName.searchPath(getenv("LIB"w), r"mingw\kernel32.lib"[], false))
232235
return FileName.path(p).ptr;
233-
}
234236

235237
return null;
236238
}
@@ -326,6 +328,12 @@ version (IN_LLVM) { /* not needed */ } else
326328
cmdbuf.writestring(p);
327329
cmdbuf.writeByte('\"');
328330
}
331+
if (auto p = getBuiltinLibPath())
332+
{
333+
cmdbuf.writestring(" /LIBPATH:\"");
334+
cmdbuf.writestring(p);
335+
cmdbuf.writeByte('\"');
336+
}
329337
if (auto p = getenv("DXSDK_DIR"w))
330338
{
331339
// support for old DX SDK installations

0 commit comments

Comments
 (0)