Move OrderedTargetDependSet into VS superclass
We move cmGlobalVisualStudio7Generator::OrderedTargetDependSet up to cmGlobalVisualStudioGenerator so it can be re-used for other VS versions. See issue #9568.
This commit is contained in:
parent
cc8c4a3f4f
commit
7e5c571cce
@ -658,34 +658,6 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
bool
|
|
||||||
cmGlobalVisualStudio7Generator::TargetCompare
|
|
||||||
::operator()(cmTarget const* l, cmTarget const* r)
|
|
||||||
{
|
|
||||||
// Make sure ALL_BUILD is first so it is the default active project.
|
|
||||||
if(strcmp(r->GetName(), "ALL_BUILD") == 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(strcmp(l->GetName(), "ALL_BUILD") == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return strcmp(l->GetName(), r->GetName()) < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
cmGlobalVisualStudio7Generator::OrderedTargetDependSet
|
|
||||||
::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets)
|
|
||||||
{
|
|
||||||
for(cmGlobalGenerator::TargetDependSet::const_iterator ti =
|
|
||||||
targets.begin(); ti != targets.end(); ++ti)
|
|
||||||
{
|
|
||||||
this->insert(*ti);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static cmVS7FlagTable cmVS7ExtraFlagTable[] =
|
static cmVS7FlagTable cmVS7ExtraFlagTable[] =
|
||||||
{
|
{
|
||||||
|
@ -92,11 +92,6 @@ public:
|
|||||||
///! What is the configurations directory variable called?
|
///! What is the configurations directory variable called?
|
||||||
virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
|
virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
|
||||||
|
|
||||||
struct TargetCompare
|
|
||||||
{
|
|
||||||
bool operator()(cmTarget const* l, cmTarget const* r);
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual const char* GetIDEVersion() { return "7.0"; }
|
virtual const char* GetIDEVersion() { return "7.0"; }
|
||||||
|
|
||||||
@ -116,12 +111,6 @@ protected:
|
|||||||
virtual void WriteSLNHeader(std::ostream& fout);
|
virtual void WriteSLNHeader(std::ostream& fout);
|
||||||
virtual void AddPlatformDefinitions(cmMakefile* mf);
|
virtual void AddPlatformDefinitions(cmMakefile* mf);
|
||||||
|
|
||||||
class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void WriteTargetsToSolution(
|
virtual void WriteTargetsToSolution(
|
||||||
std::ostream& fout,
|
std::ostream& fout,
|
||||||
cmLocalGenerator* root,
|
cmLocalGenerator* root,
|
||||||
|
@ -726,3 +726,31 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget& target)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
cmGlobalVisualStudioGenerator::TargetCompare
|
||||||
|
::operator()(cmTarget const* l, cmTarget const* r) const
|
||||||
|
{
|
||||||
|
// Make sure ALL_BUILD is first so it is the default active project.
|
||||||
|
if(strcmp(r->GetName(), "ALL_BUILD") == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(strcmp(l->GetName(), "ALL_BUILD") == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return strcmp(l->GetName(), r->GetName()) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
|
||||||
|
::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets)
|
||||||
|
{
|
||||||
|
for(cmGlobalGenerator::TargetDependSet::const_iterator ti =
|
||||||
|
targets.begin(); ti != targets.end(); ++ti)
|
||||||
|
{
|
||||||
|
this->insert(*ti);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -74,6 +74,17 @@ protected:
|
|||||||
virtual bool VSLinksDependencies() const { return true; }
|
virtual bool VSLinksDependencies() const { return true; }
|
||||||
|
|
||||||
virtual const char* GetIDEVersion() = 0;
|
virtual const char* GetIDEVersion() = 0;
|
||||||
|
|
||||||
|
struct TargetCompare
|
||||||
|
{
|
||||||
|
bool operator()(cmTarget const* l, cmTarget const* r) const;
|
||||||
|
};
|
||||||
|
class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void FixUtilityDependsForTarget(cmTarget& target);
|
void FixUtilityDependsForTarget(cmTarget& target);
|
||||||
void CreateUtilityDependTarget(cmTarget& target);
|
void CreateUtilityDependTarget(cmTarget& target);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user