mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00
Fixed #65 — Renaming shared lib
This commit is contained in:
parent
8df15e7b64
commit
fb5618e336
2 changed files with 21 additions and 16 deletions
|
@ -262,21 +262,23 @@ int linkObjToBinary(bool sharedLib)
|
||||||
output = FileName::removeExt((char*)global.params.objfiles->data[0]);
|
output = FileName::removeExt((char*)global.params.objfiles->data[0]);
|
||||||
else
|
else
|
||||||
output = "a.out";
|
output = "a.out";
|
||||||
|
|
||||||
|
if (sharedLib) {
|
||||||
|
std::string libExt = std::string(".") + global.dll_ext;
|
||||||
|
if (!endsWith(output, libExt))
|
||||||
|
{
|
||||||
|
if (global.params.os != OSWindows)
|
||||||
|
output = "lib" + output + libExt;
|
||||||
|
else
|
||||||
|
output.append(libExt);
|
||||||
|
}
|
||||||
|
args.push_back("-shared");
|
||||||
|
} else if (global.params.os == OSWindows && !endsWith(output, ".exe")) {
|
||||||
|
output.append(".exe");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sharedLib) {
|
|
||||||
std::string libExt = std::string(".") + global.dll_ext;
|
|
||||||
if (!endsWith(output, libExt))
|
|
||||||
{
|
|
||||||
if (global.params.os != OSWindows)
|
|
||||||
output = "lib" + output + libExt;
|
|
||||||
else
|
|
||||||
output.append(libExt);
|
|
||||||
}
|
|
||||||
args.push_back("-shared");
|
|
||||||
} else if (global.params.os == OSWindows && !endsWith(output, ".exe")) {
|
|
||||||
output.append(".exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
args.push_back("-o");
|
args.push_back("-o");
|
||||||
args.push_back(output.c_str());
|
args.push_back(output.c_str());
|
||||||
|
|
|
@ -407,9 +407,12 @@ int main(int argc, char** argv)
|
||||||
error("flags conflict with -run");
|
error("flags conflict with -run");
|
||||||
fatal();
|
fatal();
|
||||||
}
|
}
|
||||||
else
|
else if (global.params.objname && files.dim > 1) {
|
||||||
{
|
if (createStaticLib || createSharedLib)
|
||||||
if (global.params.objname && files.dim > 1 && !singleObj)
|
{
|
||||||
|
singleObj = true;
|
||||||
|
}
|
||||||
|
if (!singleObj)
|
||||||
{
|
{
|
||||||
error("multiple source files, but only one .obj name");
|
error("multiple source files, but only one .obj name");
|
||||||
fatal();
|
fatal();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue