summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-10 16:41:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-15 20:40:56 (GMT)
commitc4ae157865291d73113f81d4c9a9c2dd86598efc (patch)
tree8163dbedec892a7ea48b3548a9b17a954705e10c
parent6d27a3dbfbfb8852d8b8ff5c6fc7432eebc604e5 (diff)
downloadCMake-c4ae157865291d73113f81d4c9a9c2dd86598efc.zip
CMake-c4ae157865291d73113f81d4c9a9c2dd86598efc.tar.gz
CMake-c4ae157865291d73113f81d4c9a9c2dd86598efc.tar.bz2
Genex: Port some access API to cmGeneratorTarget.
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx11
-rw-r--r--Source/cmGeneratorExpression.cxx8
-rw-r--r--Source/cmGeneratorExpression.h19
-rw-r--r--Source/cmGeneratorExpressionContext.h9
-rw-r--r--Source/cmGeneratorExpressionNode.cxx10
-rw-r--r--Source/cmGeneratorTarget.cxx12
-rw-r--r--Source/cmGlobalGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.h6
8 files changed, 39 insertions, 40 deletions
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index f8dbe31..fe5717a 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -84,13 +84,14 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
false, &gDummyHead,
gtgt, &dagChecker);
- const std::set<cmTarget const*> &allTargets = cge->GetAllTargetsSeen();
- for(std::set<cmTarget const*>::const_iterator li = allTargets.begin();
- li != allTargets.end(); ++li)
+ const std::set<cmGeneratorTarget const*> &allTargets =
+ cge->GetAllTargetsSeen();
+ for(std::set<cmGeneratorTarget const*>::const_iterator li =
+ allTargets.begin(); li != allTargets.end(); ++li)
{
- if(emitted.insert(*li).second)
+ if(emitted.insert((*li)->Target).second)
{
- this->Exports.push_back(*li);
+ this->Exports.push_back((*li)->Target);
}
}
return result;
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index d9f67f2..6796a01 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -11,10 +11,9 @@
============================================================================*/
#include "cmGeneratorExpression.h"
-#include "cmMakefile.h"
-#include "cmTarget.h"
#include "assert.h"
#include "cmAlgorithms.h"
+#include "cmSystemTools.h"
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorExpressionLexer.h"
@@ -463,10 +462,11 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string &input)
//----------------------------------------------------------------------------
void
-cmCompiledGeneratorExpression::GetMaxLanguageStandard(cmTarget const* tgt,
+cmCompiledGeneratorExpression::GetMaxLanguageStandard(
+ const cmGeneratorTarget* tgt,
std::map<std::string, std::string>& mapping)
{
- typedef std::map<cmTarget const*,
+ typedef std::map<cmGeneratorTarget const*,
std::map<std::string, std::string> > MapType;
MapType::const_iterator it = this->MaxLanguageStandard.find(tgt);
if (it != this->MaxLanguageStandard.end())
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index d64d6ba..efd381b 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -19,7 +19,6 @@
#include <cmsys/RegularExpression.hxx>
#include <cmsys/auto_ptr.hxx>
-class cmTarget;
class cmGeneratorTarget;
class cmLocalGenerator;
class cmListFileBacktrace;
@@ -92,13 +91,13 @@ public:
std::string const& language = std::string()) const;
/** Get set of targets found during evaluations. */
- std::set<cmTarget*> const& GetTargets() const
+ std::set<cmGeneratorTarget*> const& GetTargets() const
{ return this->DependTargets; }
std::set<std::string> const& GetSeenTargetProperties() const
{ return this->SeenTargetProperties; }
- std::set<cmTarget const*> const& GetAllTargetsSeen() const
+ std::set<cmGeneratorTarget const*> const& GetAllTargetsSeen() const
{ return this->AllTargetsSeen; }
~cmCompiledGeneratorExpression();
@@ -120,7 +119,7 @@ public:
{
return this->HadHeadSensitiveCondition;
}
- std::set<cmTarget const*> GetSourceSensitiveTargets() const
+ std::set<cmGeneratorTarget const*> GetSourceSensitiveTargets() const
{
return this->SourceSensitiveTargets;
}
@@ -130,7 +129,7 @@ public:
this->EvaluateForBuildsystem = eval;
}
- void GetMaxLanguageStandard(cmTarget const* tgt,
+ void GetMaxLanguageStandard(cmGeneratorTarget const* tgt,
std::map<std::string, std::string>& mapping);
private:
@@ -150,15 +149,15 @@ private:
const std::string Input;
bool NeedsEvaluation;
- mutable std::set<cmTarget*> DependTargets;
- mutable std::set<cmTarget const*> AllTargetsSeen;
+ mutable std::set<cmGeneratorTarget*> DependTargets;
+ mutable std::set<cmGeneratorTarget const*> AllTargetsSeen;
mutable std::set<std::string> SeenTargetProperties;
- mutable std::map<cmTarget const*, std::map<std::string, std::string> >
- MaxLanguageStandard;
+ mutable std::map<cmGeneratorTarget const*,
+ std::map<std::string, std::string> > MaxLanguageStandard;
mutable std::string Output;
mutable bool HadContextSensitiveCondition;
mutable bool HadHeadSensitiveCondition;
- mutable std::set<cmTarget const*> SourceSensitiveTargets;
+ mutable std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
bool EvaluateForBuildsystem;
};
diff --git a/Source/cmGeneratorExpressionContext.h b/Source/cmGeneratorExpressionContext.h
index 934e2e7..e802138 100644
--- a/Source/cmGeneratorExpressionContext.h
+++ b/Source/cmGeneratorExpressionContext.h
@@ -18,7 +18,6 @@
#include <map>
#include <string>
-class cmTarget;
class cmGeneratorTarget;
class cmLocalGenerator;
@@ -34,11 +33,11 @@ struct cmGeneratorExpressionContext
cmListFileBacktrace Backtrace;
- std::set<cmTarget*> DependTargets;
- std::set<cmTarget const*> AllTargets;
+ std::set<cmGeneratorTarget*> DependTargets;
+ std::set<cmGeneratorTarget const*> AllTargets;
std::set<std::string> SeenTargetProperties;
- std::set<cmTarget const*> SourceSensitiveTargets;
- std::map<cmTarget const*, std::map<std::string, std::string> >
+ std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
+ std::map<cmGeneratorTarget const*, std::map<std::string, std::string> >
MaxLanguageStandard;
cmLocalGenerator *LG;
std::string Config;
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index dcb1c5c..8521a15 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -964,7 +964,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
}
- context->AllTargets.insert(target->Target);
+ context->AllTargets.insert(target);
}
if (target == context->HeadTarget)
@@ -977,7 +977,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if (propertyName == "SOURCES")
{
- context->SourceSensitiveTargets.insert(target->Target);
+ context->SourceSensitiveTargets.insert(target);
}
if (propertyName.empty())
@@ -1412,7 +1412,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
l = standardDefault;
}
assert(l);
- context->MaxLanguageStandard[target->Target][lit->first] = l;
+ context->MaxLanguageStandard[target][lit->first] = l;
}
else
{
@@ -1756,8 +1756,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
"be used while evaluating link libraries");
return std::string();
}
- context->DependTargets.insert(target->Target);
- context->AllTargets.insert(target->Target);
+ context->DependTargets.insert(target);
+ context->AllTargets.insert(target);
std::string result =
TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6bebc2b..ca91f53 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2173,9 +2173,9 @@ cmTargetTraceDependencies
si != sources.end(); ++si)
{
cmSourceFile* sf = *si;
- const std::set<cmTarget const*> tgts =
+ const std::set<cmGeneratorTarget const*> tgts =
this->GlobalGenerator->GetFilenameTargetDepends(sf);
- if (tgts.find(this->Target) != tgts.end())
+ if (tgts.find(this->GeneratorTarget) != tgts.end())
{
std::ostringstream e;
e << "Evaluation output file\n \"" << sf->GetFullPath()
@@ -2353,7 +2353,7 @@ cmTargetTraceDependencies
cmGeneratorExpression ge(cc.GetBacktrace());
// Add target-level dependencies referenced by generator expressions.
- std::set<cmTarget*> targets;
+ std::set<cmGeneratorTarget*> targets;
for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin();
cit != cc.GetCommandLines().end(); ++cit)
@@ -2379,12 +2379,12 @@ cmTargetTraceDependencies
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
= ge.Parse(*cli);
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
- std::set<cmTarget*> geTargets = cge->GetTargets();
+ std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
targets.insert(geTargets.begin(), geTargets.end());
}
}
- for(std::set<cmTarget*>::iterator ti = targets.begin();
+ for(std::set<cmGeneratorTarget*>::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
this->Target->AddUtility((*ti)->GetName());
@@ -5412,7 +5412,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
this->LinkImplicitNullProperties.insert(*it);
}
}
- cge->GetMaxLanguageStandard(this->Target,
+ cge->GetMaxLanguageStandard(this,
this->MaxLanguageStandards);
}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e8be2d6..3afcb42 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -3029,13 +3029,13 @@ std::string cmGlobalGenerator::EscapeJSON(const std::string& s) {
//----------------------------------------------------------------------------
void cmGlobalGenerator::SetFilenameTargetDepends(cmSourceFile* sf,
- std::set<cmTarget const*> tgts)
+ std::set<cmGeneratorTarget const*> tgts)
{
this->FilenameTargetDepends[sf] = tgts;
}
//----------------------------------------------------------------------------
-std::set<cmTarget const*> const&
+std::set<cmGeneratorTarget const*> const&
cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const {
return this->FilenameTargetDepends[sf];
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index fc81708..6887409 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -354,8 +354,8 @@ public:
void CreateEvaluationSourceFiles(std::string const& config) const;
void SetFilenameTargetDepends(cmSourceFile* sf,
- std::set<cmTarget const*> tgts);
- std::set<cmTarget const*> const&
+ std::set<const cmGeneratorTarget*> tgts);
+ const std::set<const cmGeneratorTarget*>&
GetFilenameTargetDepends(cmSourceFile* sf) const;
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -508,7 +508,7 @@ private:
// track targets to issue CMP0042 warning for.
std::set<std::string> CMP0042WarnTargets;
- mutable std::map<cmSourceFile*, std::set<cmTarget const*> >
+ mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*> >
FilenameTargetDepends;
#if defined(CMAKE_BUILD_WITH_CMAKE)