mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Use -of for object name when building executable with -singleobj.
This is what DMD does, and arguably the expected behavior – otherwise, there would be no way other than using -od to prevent races if two compiler instances could ever compile the same file(s) at the same time (e.g. for debug/release configurations). Should we transition to assuming -singleobj by default?
This commit is contained in:
@@ -1036,7 +1036,19 @@ int main(int argc, char** argv)
|
||||
{
|
||||
Module* m = static_cast<Module*>(modules.data[0]);
|
||||
char* name = m->toChars();
|
||||
char* filename = m->objfile->name->str;
|
||||
|
||||
char* oname;
|
||||
char* filename;
|
||||
if ((oname = global.params.exefile) || (oname = global.params.objname))
|
||||
{
|
||||
filename = FileName::forceExt(oname, global.obj_ext)->toChars();
|
||||
if (global.params.objdir)
|
||||
{
|
||||
filename = FileName::combine(global.params.objdir, FileName::name(filename));
|
||||
}
|
||||
}
|
||||
else
|
||||
filename = m->objfile->name->str;
|
||||
|
||||
llvm::Linker linker(name, name, context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user