cmTarget: Rename struct to be more re-usable.
The same struct can be used to represent COMPILE_OPTIONS content.
This commit is contained in:
parent
1319a147bd
commit
47f80d9c43
|
@ -130,19 +130,19 @@ public:
|
||||||
typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
|
typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
|
||||||
SourceEntriesType SourceEntries;
|
SourceEntriesType SourceEntries;
|
||||||
|
|
||||||
struct IncludeDirectoriesEntry {
|
struct TargetPropertyEntry {
|
||||||
IncludeDirectoriesEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
|
TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
|
||||||
const std::string &targetName = std::string())
|
const std::string &targetName = std::string())
|
||||||
: ge(cge), TargetName(targetName)
|
: ge(cge), TargetName(targetName)
|
||||||
{}
|
{}
|
||||||
const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
|
const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
|
||||||
std::vector<std::string> CachedIncludes;
|
std::vector<std::string> CachedEntries;
|
||||||
const std::string TargetName;
|
const std::string TargetName;
|
||||||
};
|
};
|
||||||
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
|
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
|
||||||
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
|
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
|
||||||
|
|
||||||
std::map<std::string, std::vector<IncludeDirectoriesEntry*> >
|
std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceIncludeDirectoriesEntries;
|
CachedLinkInterfaceIncludeDirectoriesEntries;
|
||||||
std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
|
std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
|
||||||
|
|
||||||
|
@ -152,9 +152,9 @@ public:
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void deleteAndClear(
|
void deleteAndClear(
|
||||||
std::vector<cmTargetInternals::IncludeDirectoriesEntry*> &entries)
|
std::vector<cmTargetInternals::TargetPropertyEntry*> &entries)
|
||||||
{
|
{
|
||||||
for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
|
for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
|
||||||
it = entries.begin(),
|
it = entries.begin(),
|
||||||
end = entries.end();
|
end = entries.end();
|
||||||
it != end; ++it)
|
it != end; ++it)
|
||||||
|
@ -167,10 +167,10 @@ void deleteAndClear(
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void deleteAndClear(
|
void deleteAndClear(
|
||||||
std::map<std::string,
|
std::map<std::string,
|
||||||
std::vector<cmTargetInternals::IncludeDirectoriesEntry*> > &entries)
|
std::vector<cmTargetInternals::TargetPropertyEntry*> > &entries)
|
||||||
{
|
{
|
||||||
for (std::map<std::string,
|
for (std::map<std::string,
|
||||||
std::vector<cmTargetInternals::IncludeDirectoriesEntry*> >::iterator
|
std::vector<cmTargetInternals::TargetPropertyEntry*> >::iterator
|
||||||
it = entries.begin(), end = entries.end(); it != end; ++it)
|
it = entries.begin(), end = entries.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
deleteAndClear(it->second);
|
deleteAndClear(it->second);
|
||||||
|
@ -2728,7 +2728,7 @@ void cmTarget::SetProperty(const char* prop, const char* value)
|
||||||
deleteAndClear(this->Internal->IncludeDirectoriesEntries);
|
deleteAndClear(this->Internal->IncludeDirectoriesEntries);
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
||||||
this->Internal->IncludeDirectoriesEntries.push_back(
|
this->Internal->IncludeDirectoriesEntries.push_back(
|
||||||
new cmTargetInternals::IncludeDirectoriesEntry(cge));
|
new cmTargetInternals::TargetPropertyEntry(cge));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
||||||
|
@ -2770,7 +2770,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
|
||||||
this->Makefile->GetBacktrace(lfbt);
|
this->Makefile->GetBacktrace(lfbt);
|
||||||
cmGeneratorExpression ge(lfbt);
|
cmGeneratorExpression ge(lfbt);
|
||||||
this->Internal->IncludeDirectoriesEntries.push_back(
|
this->Internal->IncludeDirectoriesEntries.push_back(
|
||||||
new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value)));
|
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
||||||
|
@ -2854,17 +2854,17 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
|
||||||
{
|
{
|
||||||
cmGeneratorExpression ge(entry.Backtrace);
|
cmGeneratorExpression ge(entry.Backtrace);
|
||||||
|
|
||||||
std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::iterator position
|
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
|
||||||
= before ? this->Internal->IncludeDirectoriesEntries.begin()
|
= before ? this->Internal->IncludeDirectoriesEntries.begin()
|
||||||
: this->Internal->IncludeDirectoriesEntries.end();
|
: this->Internal->IncludeDirectoriesEntries.end();
|
||||||
|
|
||||||
this->Internal->IncludeDirectoriesEntries.insert(position,
|
this->Internal->IncludeDirectoriesEntries.insert(position,
|
||||||
new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(entry.Value)));
|
new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static void processIncludeDirectories(cmTarget *tgt,
|
static void processIncludeDirectories(cmTarget *tgt,
|
||||||
const std::vector<cmTargetInternals::IncludeDirectoriesEntry*> &entries,
|
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
||||||
std::vector<std::string> &includes,
|
std::vector<std::string> &includes,
|
||||||
std::set<std::string> &uniqueIncludes,
|
std::set<std::string> &uniqueIncludes,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker,
|
cmGeneratorExpressionDAGChecker *dagChecker,
|
||||||
|
@ -2872,12 +2872,12 @@ static void processIncludeDirectories(cmTarget *tgt,
|
||||||
{
|
{
|
||||||
cmMakefile *mf = tgt->GetMakefile();
|
cmMakefile *mf = tgt->GetMakefile();
|
||||||
|
|
||||||
for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
|
for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
|
||||||
it = entries.begin(), end = entries.end(); it != end; ++it)
|
it = entries.begin(), end = entries.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
bool testIsOff = true;
|
bool testIsOff = true;
|
||||||
bool cacheIncludes = false;
|
bool cacheIncludes = false;
|
||||||
std::vector<std::string> entryIncludes = (*it)->CachedIncludes;
|
std::vector<std::string> entryIncludes = (*it)->CachedEntries;
|
||||||
if(!entryIncludes.empty())
|
if(!entryIncludes.empty())
|
||||||
{
|
{
|
||||||
testIsOff = false;
|
testIsOff = false;
|
||||||
|
@ -2980,7 +2980,7 @@ static void processIncludeDirectories(cmTarget *tgt,
|
||||||
}
|
}
|
||||||
if (cacheIncludes)
|
if (cacheIncludes)
|
||||||
{
|
{
|
||||||
(*it)->CachedIncludes = entryIncludes;
|
(*it)->CachedEntries = entryIncludes;
|
||||||
}
|
}
|
||||||
if (!usedIncludes.empty())
|
if (!usedIncludes.empty())
|
||||||
{
|
{
|
||||||
|
@ -3066,7 +3066,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
|
||||||
|
|
||||||
this->Internal
|
this->Internal
|
||||||
->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
|
->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
|
||||||
new cmTargetInternals::IncludeDirectoriesEntry(cge,
|
new cmTargetInternals::TargetPropertyEntry(cge,
|
||||||
it->Value));
|
it->Value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3512,9 +3512,9 @@ const char *cmTarget::GetProperty(const char* prop,
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = "";
|
output = "";
|
||||||
std::string sep;
|
std::string sep;
|
||||||
typedef cmTargetInternals::IncludeDirectoriesEntry
|
typedef cmTargetInternals::TargetPropertyEntry
|
||||||
IncludeDirectoriesEntry;
|
TargetPropertyEntry;
|
||||||
for (std::vector<IncludeDirectoriesEntry*>::const_iterator
|
for (std::vector<TargetPropertyEntry*>::const_iterator
|
||||||
it = this->Internal->IncludeDirectoriesEntries.begin(),
|
it = this->Internal->IncludeDirectoriesEntries.begin(),
|
||||||
end = this->Internal->IncludeDirectoriesEntries.end();
|
end = this->Internal->IncludeDirectoriesEntries.end();
|
||||||
it != end; ++it)
|
it != end; ++it)
|
||||||
|
|
Loading…
Reference in New Issue