Commit dee197fe authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

GHS: Use a cmGeneratorTarget in generator API.

parent b2b41b83
...@@ -21,23 +21,24 @@ ...@@ -21,23 +21,24 @@
std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic"); std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget *target) cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
: Target(target) : Target(target->Target)
, GeneratorTarget(target)
, LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>( , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
target->GetMakefile()->GetLocalGenerator())) target->GetLocalGenerator()))
, Makefile(target->GetMakefile()) , Makefile(target->Target->GetMakefile())
, TargetGroup(DetermineIfTargetGroup(target)) , TargetGroup(DetermineIfTargetGroup(target->Target))
, DynamicDownload(false) , DynamicDownload(false)
{ {
this->RelBuildFilePath = this->GetRelBuildFilePath(target); this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
this->RelOutputFileName = this->RelOutputFileName =
this->RelBuildFilePath + this->Target->GetName() + ".a"; this->RelBuildFilePath + this->Target->GetName() + ".a";
this->RelBuildFileName = this->RelBuildFilePath; this->RelBuildFileName = this->RelBuildFilePath;
this->RelBuildFileName += this->GetBuildFileName(target); this->RelBuildFileName += this->GetBuildFileName(target->Target);
std::string absPathToRoot = this->GetAbsPathToRoot(target); std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot); absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath; this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName; this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
...@@ -373,7 +374,6 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries() ...@@ -373,7 +374,6 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
cmTarget *tg(GetGlobalGenerator()->FindTarget(libName)); cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
if (NULL != tg) if (NULL != tg)
{ {
cmGhsMultiTargetGenerator gmtg(tg);
libName = tg->GetName() + ".a"; libName = tg->GetName() + ".a";
} }
*this->GetFolderBuildStreams() << " -l\"" << libName << "\"" *this->GetFolderBuildStreams() << " -l\"" << libName << "\""
......
...@@ -27,7 +27,7 @@ class cmCustomCommand; ...@@ -27,7 +27,7 @@ class cmCustomCommand;
class cmGhsMultiTargetGenerator class cmGhsMultiTargetGenerator
{ {
public: public:
cmGhsMultiTargetGenerator(cmTarget *target); cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
virtual ~cmGhsMultiTargetGenerator(); virtual ~cmGhsMultiTargetGenerator();
...@@ -100,6 +100,7 @@ private: ...@@ -100,6 +100,7 @@ private:
const std::string &language); const std::string &language);
cmTarget *Target; cmTarget *Target;
cmGeneratorTarget* GeneratorTarget;
cmLocalGhsMultiGenerator *LocalGenerator; cmLocalGhsMultiGenerator *LocalGenerator;
cmMakefile *Makefile; cmMakefile *Makefile;
std::string AbsBuildFilePath; std::string AbsBuildFilePath;
......
...@@ -37,7 +37,7 @@ void cmLocalGhsMultiGenerator::Generate() ...@@ -37,7 +37,7 @@ void cmLocalGhsMultiGenerator::Generate()
{ {
continue; continue;
} }
cmGhsMultiTargetGenerator tg(l->second->Target); cmGhsMultiTargetGenerator tg(l->second);
tg.Generate(); tg.Generate();
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment