From 06f56d3bf5d8210d190e1bfcf05673ceb78c5594 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 15 Oct 2015 00:23:53 +0200 Subject: [PATCH] cmLocalUnixMakefileGenerator3: Port AppendCleanCommand to cmGeneratorTarget. --- Source/cmLocalUnixMakefileGenerator3.cxx | 10 ++++------ Source/cmLocalUnixMakefileGenerator3.h | 2 +- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmMakefileTargetGenerator.cxx | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index f0373e037..2e7a13406 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1218,11 +1218,11 @@ void cmLocalUnixMakefileGenerator3 ::AppendCleanCommand(std::vector& commands, const std::vector& files, - cmTarget& target, const char* filename) + cmGeneratorTarget* target, const char* filename) { std::string cleanfile = this->Makefile->GetCurrentBinaryDirectory(); cleanfile += "/"; - cleanfile += this->GetTargetDirectory(target); + cleanfile += this->GetTargetDirectory(target->Target); cleanfile += "/cmake_clean"; if(filename) { @@ -1256,14 +1256,12 @@ cmLocalUnixMakefileGenerator3 { // Get the set of source languages in the target. std::set languages; - cmGeneratorTarget *gtgt = - this->GlobalGenerator->GetGeneratorTarget(&target); - gtgt->GetLanguages(languages, + target->GetLanguages(languages, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); fout << "\n" << "# Per-language clean rules from dependency scanning.\n" << "foreach(lang " << cmJoin(languages, " ") << ")\n" - << " include(" << this->GetTargetDirectory(target) + << " include(" << this->GetTargetDirectory(target->Target) << "/cmake_clean_${lang}.cmake OPTIONAL)\n" << "endforeach()\n"; } diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index fb5ac2ff9..032e501d0 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -226,7 +226,7 @@ protected: std::ostream* content = 0); void AppendCleanCommand(std::vector& commands, const std::vector& files, - cmTarget& target, const char* filename =0); + cmGeneratorTarget* target, const char* filename =0); // Helper methods for dependeny updates. bool ScanDependencies(const char* targetDir, diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 8b60a23b6..1278dcd45 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -444,7 +444,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules if(this->Target->GetType() == cmTarget::STATIC_LIBRARY) { this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles, - *this->Target, "target"); + this->GeneratorTarget, "target"); this->LocalGenerator->CreateCDCommand (commands1, this->Makefile->GetCurrentBinaryDirectory(), diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 94d583bf1..007a997c6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -932,7 +932,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() // Construct the clean command. this->LocalGenerator->AppendCleanCommand(commands, this->CleanFiles, - *this->Target); + this->GeneratorTarget); this->LocalGenerator->CreateCDCommand (commands, this->LocalGenerator->GetCurrentBinaryDirectory(),