Do not append extension if library filee name already has one.

This is the same behavior as dmd. Fixes issue #1084.
This commit is contained in:
Kai Nacke 2015-09-17 23:25:50 +02:00
parent ab2e8e3646
commit c3a79cb867

View file

@ -458,9 +458,8 @@ void createStaticLibrary()
// As a side effect this change broke compiling with dub.
// if (!FileName::absolute(libName.c_str()))
// libName = FileName::combine(global.params.objdir, libName.c_str());
std::string libExt = std::string(".") + global.lib_ext;
if (!endsWith(libName, libExt))
libName.append(libExt);
if (llvm::sys::path::extension(libName).empty())
libName.append(std::string(".") + global.lib_ext);
if (isTargetWindows)
args.push_back("/OUT:" + libName);
else