Fixed #65 — Renaming shared lib

This commit is contained in:
Alexey Prokhin 2012-02-14 19:12:37 +04:00
parent 8df15e7b64
commit fb5618e336
2 changed files with 21 additions and 16 deletions

View file

@ -262,7 +262,6 @@ 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) { if (sharedLib) {
std::string libExt = std::string(".") + global.dll_ext; std::string libExt = std::string(".") + global.dll_ext;
@ -277,6 +276,9 @@ int linkObjToBinary(bool sharedLib)
} else if (global.params.os == OSWindows && !endsWith(output, ".exe")) { } else if (global.params.os == OSWindows && !endsWith(output, ".exe")) {
output.append(".exe"); output.append(".exe");
} }
}
args.push_back("-o"); args.push_back("-o");
args.push_back(output.c_str()); args.push_back(output.c_str());

View file

@ -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();