diff --git a/dmd/module.c b/dmd/module.c index d59db1f5..8487f63b 100644 --- a/dmd/module.c +++ b/dmd/module.c @@ -219,7 +219,7 @@ static void check_and_add_output_file(Module* NewMod, const std::string& str) files.insert(std::make_pair(str, NewMod)); } -void Module::buildTargetFiles() +void Module::buildTargetFiles(bool singleObj) { if(objfile && (!doDocComment || docfile) && @@ -252,7 +252,8 @@ void Module::buildTargetFiles() // LDC // another safety check to make sure we don't overwrite previous output files - check_and_add_output_file(this, objfile->name->str); + if (!singleObj) + check_and_add_output_file(this, objfile->name->str); if (docfile) check_and_add_output_file(this, docfile->name->str); if (hdrfile) diff --git a/dmd/module.h b/dmd/module.h index 652b07bd..22109d5b 100644 --- a/dmd/module.h +++ b/dmd/module.h @@ -188,7 +188,7 @@ struct Module : Package #if IN_LLVM // LDC llvm::Module* genLLVMModule(llvm::LLVMContext& context, Ir* sir); - void buildTargetFiles(); + void buildTargetFiles(bool singleObj); File* buildFilePath(const char* forcename, const char* path, const char* ext); Module *isModule() { return this; } diff --git a/gen/main.cpp b/gen/main.cpp index 30d398c0..324ccdcd 100644 --- a/gen/main.cpp +++ b/gen/main.cpp @@ -781,7 +781,7 @@ LDC_TARGETS m->importedFrom = m; m->read(0); m->parse(); - m->buildTargetFiles(); + m->buildTargetFiles(singleObj); m->deleteObjFile(); if (m->isDocFile) {