Fixed #21 — Added -lib switch

This commit is contained in:
Alexey Prokhin 2011-12-06 17:24:49 +04:00
parent 859ae8481f
commit fdead0d154
8 changed files with 137 additions and 18 deletions

View file

@ -388,7 +388,7 @@ int main(int argc, char** argv)
}
// only link if possible
if (!global.params.obj || !global.params.output_o)
if (!global.params.obj || !global.params.output_o || createStaticLib)
global.params.link = 0;
if (global.params.link)
@ -1028,11 +1028,15 @@ LDC_TARGETS
{
if (global.params.link)
error("no object files to link");
else if (createStaticLib)
error("no object files");
}
else
{
if (global.params.link)
status = linkObjToExecutable(global.params.argv0);
else if (createStaticLib)
createStaticLibrary();
if (global.params.run)
{