COMP: Fix build with concept checking of STL.
- Fix cmSourceGroup to not use std::vector with an incomplete type.
This commit is contained in:
parent
f43748e1dd
commit
10db44a81d
@ -532,7 +532,7 @@ void cmLocalVisualStudio6Generator
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<cmSourceGroup> children = sg->GetGroupChildren();
|
||||
std::vector<cmSourceGroup> const& children = sg->GetGroupChildren();
|
||||
|
||||
for(unsigned int i=0;i<children.size();++i)
|
||||
{
|
||||
|
@ -1473,7 +1473,7 @@ void cmLocalVisualStudio7Generator
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<cmSourceGroup> children = sg->GetGroupChildren();
|
||||
std::vector<cmSourceGroup> const& children = sg->GetGroupChildren();
|
||||
|
||||
for(unsigned int i=0;i<children.size();++i)
|
||||
{
|
||||
|
@ -16,12 +16,46 @@
|
||||
=========================================================================*/
|
||||
#include "cmSourceGroup.h"
|
||||
|
||||
class cmSourceGroupInternals
|
||||
{
|
||||
public:
|
||||
std::vector<cmSourceGroup> GroupChildren;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup::cmSourceGroup(const char* name, const char* regex): Name(name)
|
||||
{
|
||||
this->Internal = new cmSourceGroupInternals;
|
||||
this->SetGroupRegex(regex);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup::~cmSourceGroup()
|
||||
{
|
||||
delete this->Internal;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup::cmSourceGroup(cmSourceGroup const& r)
|
||||
{
|
||||
this->Name = r.Name;
|
||||
this->GroupRegex = r.GroupRegex;
|
||||
this->GroupFiles = r.GroupFiles;
|
||||
this->SourceFiles = r.SourceFiles;
|
||||
this->Internal = new cmSourceGroupInternals(*r.Internal);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup& cmSourceGroup::operator=(cmSourceGroup const& r)
|
||||
{
|
||||
this->Name = r.Name;
|
||||
this->GroupRegex = r.GroupRegex;
|
||||
this->GroupFiles = r.GroupFiles;
|
||||
this->SourceFiles = r.SourceFiles;
|
||||
*(this->Internal) = *(r.Internal);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmSourceGroup::SetGroupRegex(const char* regex)
|
||||
{
|
||||
@ -85,15 +119,17 @@ std::vector<const cmSourceFile*>& cmSourceGroup::GetSourceFiles()
|
||||
//----------------------------------------------------------------------------
|
||||
void cmSourceGroup::AddChild(cmSourceGroup child)
|
||||
{
|
||||
this->GroupChildren.push_back(child);
|
||||
this->Internal->GroupChildren.push_back(child);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup *cmSourceGroup::lookupChild(const char* name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end();
|
||||
std::vector<cmSourceGroup>::iterator iter =
|
||||
this->Internal->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end =
|
||||
this->Internal->GroupChildren.end();
|
||||
|
||||
// st
|
||||
for(;iter!=end; ++iter)
|
||||
@ -114,8 +150,10 @@ cmSourceGroup *cmSourceGroup::lookupChild(const char* name)
|
||||
cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end();
|
||||
std::vector<cmSourceGroup>::iterator iter =
|
||||
this->Internal->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end =
|
||||
this->Internal->GroupChildren.end();
|
||||
|
||||
if(this->MatchesFiles(name))
|
||||
{
|
||||
@ -136,8 +174,10 @@ cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name)
|
||||
cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end();
|
||||
std::vector<cmSourceGroup>::iterator iter =
|
||||
this->Internal->GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end =
|
||||
this->Internal->GroupChildren.end();
|
||||
|
||||
if(this->MatchesRegex(name))
|
||||
{
|
||||
@ -154,7 +194,8 @@ cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<cmSourceGroup> cmSourceGroup::GetGroupChildren() const
|
||||
std::vector<cmSourceGroup> const&
|
||||
cmSourceGroup::GetGroupChildren() const
|
||||
{
|
||||
return this->GroupChildren;
|
||||
return this->Internal->GroupChildren;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
class cmSourceFile;
|
||||
|
||||
class cmSourceGroupInternals;
|
||||
|
||||
/** \class cmSourceGroup
|
||||
* \brief Hold a group of sources as specified by a SOURCE_GROUP command.
|
||||
*
|
||||
@ -36,7 +38,9 @@ class cmSourceGroup
|
||||
{
|
||||
public:
|
||||
cmSourceGroup(const char* name, const char* regex);
|
||||
~cmSourceGroup() {}
|
||||
cmSourceGroup(cmSourceGroup const& r);
|
||||
~cmSourceGroup();
|
||||
cmSourceGroup& operator=(cmSourceGroup const&);
|
||||
|
||||
/**
|
||||
* Set the regular expression for this group.
|
||||
@ -97,7 +101,7 @@ public:
|
||||
const std::vector<const cmSourceFile*>& GetSourceFiles() const;
|
||||
std::vector<const cmSourceFile*>& GetSourceFiles();
|
||||
|
||||
std::vector<cmSourceGroup> GetGroupChildren() const;
|
||||
std::vector<cmSourceGroup> const& GetGroupChildren() const;
|
||||
private:
|
||||
/**
|
||||
* The name of the source group.
|
||||
@ -120,7 +124,7 @@ private:
|
||||
*/
|
||||
std::vector<const cmSourceFile*> SourceFiles;
|
||||
|
||||
std::vector<cmSourceGroup> GroupChildren;
|
||||
cmSourceGroupInternals* Internal;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user