From 7f5ec9f109dc66bc22ac377a7fb57d9221aed56b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 9 Oct 2015 22:27:46 +0200 Subject: [PATCH] cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget. --- Source/cmCommonTargetGenerator.cxx | 2 +- Source/cmExtraCodeBlocksGenerator.cxx | 25 ++++++++++------------ Source/cmExtraCodeBlocksGenerator.h | 5 +++-- Source/cmExtraEclipseCDT4Generator.cxx | 4 +++- Source/cmGlobalNinjaGenerator.cxx | 4 +--- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +--- Source/cmGlobalVisualStudioGenerator.cxx | 2 +- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalGenerator.h | 3 ++- Source/cmLocalNinjaGenerator.cxx | 4 ++-- Source/cmLocalNinjaGenerator.h | 3 ++- Source/cmLocalUnixMakefileGenerator3.cxx | 12 +++++------ Source/cmLocalUnixMakefileGenerator3.h | 3 ++- Source/cmLocalVisualStudio6Generator.cxx | 2 +- Source/cmLocalVisualStudio6Generator.h | 3 ++- Source/cmLocalVisualStudio7Generator.cxx | 12 ++++++----- Source/cmLocalVisualStudio7Generator.h | 3 ++- Source/cmLocalXCodeGenerator.cxx | 2 +- Source/cmLocalXCodeGenerator.h | 3 ++- Source/cmMakefileTargetGenerator.cxx | 8 ++++--- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 16 +++++++------- 22 files changed, 65 insertions(+), 59 deletions(-) diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index f901414fc..06838fd61 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -403,7 +403,7 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const cmMakefile* mf = linkee->Target->GetMakefile(); std::string di = mf->GetCurrentBinaryDirectory(); di += "/"; - di += lg->GetTargetDirectory(*linkee->Target); + di += lg->GetTargetDirectory(linkee); dirs.push_back(di); } } diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 0406644b4..cdb4d8b00 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -358,11 +358,13 @@ void cmExtraCodeBlocksGenerator case cmTarget::MODULE_LIBRARY: case cmTarget::OBJECT_LIBRARY: { - this->AppendTarget(fout, ti->first, &ti->second, + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&ti->second); + this->AppendTarget(fout, ti->first, gt, make.c_str(), *lg, compiler.c_str()); std::string fastTarget = ti->first; fastTarget += "/fast"; - this->AppendTarget(fout, fastTarget, &ti->second, + this->AppendTarget(fout, fastTarget, gt, make.c_str(), *lg, compiler.c_str()); } break; @@ -521,14 +523,14 @@ void cmExtraCodeBlocksGenerator // Write a dummy file for OBJECT libraries, so C::B can reference some file std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile( cmLocalGenerator* lg, - cmTarget* target) const + cmGeneratorTarget* target) const { // this file doesn't seem to be used by C::B in custom makefile mode, // but we generate a unique file for each OBJECT library so in case // C::B uses it in some way, the targets don't interfere with each other. std::string filename = lg->GetCurrentBinaryDirectory(); filename += "/"; - filename += lg->GetTargetDirectory(*target); + filename += lg->GetTargetDirectory(target); filename += "/"; filename += target->GetName(); filename += ".objlib"; @@ -547,7 +549,7 @@ std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile( // Generate the xml code for one target. void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, const std::string& targetName, - cmTarget* target, + cmGeneratorTarget* target, const char* make, const cmLocalGenerator* lg, const char* compiler) @@ -559,7 +561,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, fout<<" \n"; if (target!=0) { - int cbTargetType = this->GetCBTargetType(target); + int cbTargetType = this->GetCBTargetType(target->Target); std::string workingDir = lg->GetCurrentBinaryDirectory(); if ( target->GetType()==cmTarget::EXECUTABLE) { @@ -591,9 +593,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, } else { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(target); - location = gt->GetLocation(buildType); + location = target->GetLocation(buildType); } fout<<"