diff options
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 27b7c21..ff8b604 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -597,12 +597,26 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Clean files associated with this library. std::vector<std::string> libCleanFiles; libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( - this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath)); - if (targetNameReal != targetName) { + this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal)); + + std::vector<std::string> commands1; + // Add a command to remove any existing files for this library. + // for static libs only + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { + this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles, + this->GeneratorTarget, "target"); + this->LocalGenerator->CreateCDCommand( + commands1, this->Makefile->GetCurrentBinaryDirectory(), + this->LocalGenerator->GetBinaryDirectory()); + commands.insert(commands.end(), commands1.begin(), commands1.end()); + commands1.clear(); + } + + if (targetName != targetNameReal) { libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( - this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal)); + this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath)); } - if (targetNameSO != targetName && targetNameSO != targetNameReal) { + if (targetNameSO != targetNameReal && targetNameSO != targetName) { libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathSO)); } @@ -634,19 +648,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } #endif - std::vector<std::string> commands1; - // Add a command to remove any existing files for this library. - // for static libs only - if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { - this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles, - this->GeneratorTarget, "target"); - this->LocalGenerator->CreateCDCommand( - commands1, this->Makefile->GetCurrentBinaryDirectory(), - this->LocalGenerator->GetBinaryDirectory()); - commands.insert(commands.end(), commands1.begin(), commands1.end()); - commands1.clear(); - } - // Add the pre-build and pre-link rules building but not when relinking. if (!relink) { this->LocalGenerator->AppendCustomCommands( |