summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-21 19:31:00 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-24 07:19:55 (GMT)
commitb74aa0e3d2eb90b83bbbdcc91e0b1dd721cd194f (patch)
treedc23c2e2b7f00f7a620e556775aa8f97424ec7a4 /Source
parentb92d0b2c94936fa438c8c92a6961b6323795d6f9 (diff)
downloadCMake-b74aa0e3d2eb90b83bbbdcc91e0b1dd721cd194f.zip
CMake-b74aa0e3d2eb90b83bbbdcc91e0b1dd721cd194f.tar.gz
CMake-b74aa0e3d2eb90b83bbbdcc91e0b1dd721cd194f.tar.bz2
GHS: Port to cmGeneratorTarget.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx56
-rw-r--r--Source/cmGhsMultiTargetGenerator.h11
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx11
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h2
4 files changed, 41 insertions, 39 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 01e6f8c..12115be 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -22,23 +22,22 @@
std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
- : Target(target->Target)
- , GeneratorTarget(target)
+ : GeneratorTarget(target)
, LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
target->GetLocalGenerator()))
, Makefile(target->Target->GetMakefile())
, TargetGroup(DetermineIfTargetGroup(target))
, DynamicDownload(false)
{
- this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
+ this->RelBuildFilePath = this->GetRelBuildFilePath(target);
this->RelOutputFileName =
- this->RelBuildFilePath + this->Target->GetName() + ".a";
+ this->RelBuildFilePath + target->GetName() + ".a";
this->RelBuildFileName = this->RelBuildFilePath;
- this->RelBuildFileName += this->GetBuildFileName(target->Target);
+ this->RelBuildFileName += this->GetBuildFileName(target);
- std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
+ std::string absPathToRoot = this->GetAbsPathToRoot(target);
absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
@@ -51,7 +50,8 @@ cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
}
std::string
-cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetRelBuildFilePath(
+ const cmGeneratorTarget *target)
{
std::string output;
char const *folderProp = target->GetProperty("FOLDER");
@@ -66,15 +66,13 @@ cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target)
}
std::string
-cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmGeneratorTarget *target)
{
- cmGeneratorTarget* gt = target->GetMakefile()->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- return gt->GetLocalGenerator()->GetBinaryDirectory();
+ return target->GetLocalGenerator()->GetBinaryDirectory();
}
std::string
-cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmGeneratorTarget *target)
{
std::string output;
output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target);
@@ -84,7 +82,7 @@ cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmTarget *target)
}
std::string
-cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmTarget *target)
+cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmGeneratorTarget *target)
{
std::string output;
output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
@@ -93,7 +91,8 @@ cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmTarget *target)
return output;
}
-std::string cmGhsMultiTargetGenerator::GetBuildFileName(const cmTarget *target)
+std::string
+cmGhsMultiTargetGenerator::GetBuildFileName(const cmGeneratorTarget *target)
{
std::string output;
output = target->GetName();
@@ -161,7 +160,8 @@ void cmGhsMultiTargetGenerator::Generate()
bool cmGhsMultiTargetGenerator::IncludeThisTarget()
{
bool output = true;
- char const *excludeFromAll = this->Target->GetProperty("EXCLUDE_FROM_ALL");
+ char const *excludeFromAll =
+ this->GeneratorTarget->GetProperty("EXCLUDE_FROM_ALL");
if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
'\0' == excludeFromAll[1])
{
@@ -367,13 +367,13 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
++tdsI)
{
- const cmTarget *tg = (*tdsI)->Target;
+ const cmGeneratorTarget *tg = *tdsI;
*this->GetFolderBuildStreams() << " -L\"" << GetAbsBuildFilePath(tg)
<< "\"" << std::endl;
}
// library targets
cmTarget::LinkLibraryVectorType llv =
- this->Target->GetOriginalLinkLibraries();
+ this->GeneratorTarget->Target->GetOriginalLinkLibraries();
for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
llvI != llv.end(); ++llvI)
{
@@ -391,10 +391,12 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
void cmGhsMultiTargetGenerator::WriteCustomCommands()
{
- WriteCustomCommandsHelper(this->Target->GetPreBuildCommands(),
- cmTarget::PRE_BUILD);
- WriteCustomCommandsHelper(this->Target->GetPostBuildCommands(),
- cmTarget::POST_BUILD);
+ WriteCustomCommandsHelper(
+ this->GeneratorTarget->Target->GetPreBuildCommands(),
+ cmTarget::PRE_BUILD);
+ WriteCustomCommandsHelper(
+ this->GeneratorTarget->Target->GetPostBuildCommands(),
+ cmTarget::POST_BUILD);
}
void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
@@ -518,7 +520,7 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
std::string outputDir(AbsBuildFilePath);
const char *runtimeOutputProp =
- this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
+ this->GeneratorTarget->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
if (NULL != runtimeOutputProp)
{
outputDir = runtimeOutputProp;
@@ -526,7 +528,8 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
std::string configCapped(cmSystemTools::UpperCase(config));
const char *runtimeOutputSProp =
- this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
+ this->GeneratorTarget
+ ->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
if (NULL != runtimeOutputSProp)
{
outputDir = runtimeOutputSProp;
@@ -544,9 +547,10 @@ cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
std::string
cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
{
- std::string outputFilename(this->Target->GetName());
+ std::string outputFilename(this->GeneratorTarget->GetName());
- const char *outputNameProp = this->Target->GetProperty("OUTPUT_NAME");
+ const char *outputNameProp =
+ this->GeneratorTarget->GetProperty("OUTPUT_NAME");
if (NULL != outputNameProp)
{
outputFilename = outputNameProp;
@@ -554,7 +558,7 @@ cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
std::string configCapped(cmSystemTools::UpperCase(config));
const char *outputNameSProp =
- this->Target->GetProperty(configCapped + "_OUTPUT_NAME");
+ this->GeneratorTarget->GetProperty(configCapped + "_OUTPUT_NAME");
if (NULL != outputNameSProp)
{
outputFilename = outputNameSProp;
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index d1c17f4..327fdef 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -54,11 +54,11 @@ public:
return this->AbsOutputFileName.c_str();
}
- static std::string GetRelBuildFilePath(const cmTarget *target);
- static std::string GetAbsPathToRoot(const cmTarget *target);
- static std::string GetAbsBuildFilePath(const cmTarget *target);
- static std::string GetRelBuildFileName(const cmTarget *target);
- static std::string GetBuildFileName(const cmTarget *target);
+ static std::string GetRelBuildFilePath(const cmGeneratorTarget *target);
+ static std::string GetAbsPathToRoot(const cmGeneratorTarget *target);
+ static std::string GetAbsBuildFilePath(const cmGeneratorTarget *target);
+ static std::string GetRelBuildFileName(const cmGeneratorTarget *target);
+ static std::string GetBuildFileName(const cmGeneratorTarget *target);
static std::string AddSlashIfNeededToPath(std::string const &input);
private:
@@ -99,7 +99,6 @@ private:
bool DetermineIfDynamicDownload(std::string const &config,
const std::string &language);
- cmTarget *Target;
cmGeneratorTarget* GeneratorTarget;
cmLocalGhsMultiGenerator *LocalGenerator;
cmMakefile *Makefile;
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 7c33904..1bcbd26 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -487,7 +487,7 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
tgtsI != tgts.end(); ++tgtsI)
{
const cmGeneratorTarget *tgt = *tgtsI;
- if (IsTgtForBuild(tgt->Target))
+ if (IsTgtForBuild(tgt))
{
char const *rawFolderName = tgt->GetProperty("FOLDER");
if (NULL == rawFolderName)
@@ -504,7 +504,7 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
GhsMultiGpj::PROJECT);
}
std::vector<cmsys::String> splitPath = cmSystemTools::SplitString(
- cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt->Target));
+ cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt));
std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
splitPath.back());
*this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
@@ -516,13 +516,12 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
}
}
-bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmTarget *tgt)
+bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget *tgt)
{
const std::string config =
- tgt->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ tgt->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
std::vector<cmSourceFile *> tgtSources;
- cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt);
- gt->GetSourceFiles(tgtSources, config);
+ tgt->GetSourceFiles(tgtSources, config);
bool tgtInBuild = true;
char const *excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL");
if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 04a9a5b..480cd6a 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -111,7 +111,7 @@ private:
GhsMultiGpj::Types projType);
static std::string GetFileNameFromPath(std::string const &path);
void UpdateBuildFiles(std::vector<cmGeneratorTarget*> tgts);
- bool IsTgtForBuild(const cmTarget *tgt);
+ bool IsTgtForBuild(const cmGeneratorTarget *tgt);
std::vector<cmGeneratedFileStream *> TargetSubProjects;
std::map<std::string, cmGeneratedFileStream *> TargetFolderBuildStreams;