ENH: some fixes for better backwards compatibility
This commit is contained in:
parent
63185c1388
commit
345fb993aa
|
@ -869,7 +869,8 @@ cmGlobalUnixMakefileGenerator3
|
|||
if(emitted.insert(lib->first).second)
|
||||
{
|
||||
// Add this dependency.
|
||||
this->AppendAnyGlobalDepend(depends, lib->first.c_str(), emitted);
|
||||
this->AppendAnyGlobalDepend(depends, lib->first.c_str(),
|
||||
emitted, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -883,7 +884,7 @@ cmGlobalUnixMakefileGenerator3
|
|||
if(emitted.insert(*util).second)
|
||||
{
|
||||
// Add this dependency.
|
||||
this->AppendAnyGlobalDepend(depends, util->c_str(), emitted);
|
||||
this->AppendAnyGlobalDepend(depends, util->c_str(), emitted, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -893,21 +894,36 @@ cmGlobalUnixMakefileGenerator3
|
|||
void
|
||||
cmGlobalUnixMakefileGenerator3
|
||||
::AppendAnyGlobalDepend(std::vector<std::string>& depends, const char* name,
|
||||
std::set<cmStdString>& emitted)
|
||||
std::set<cmStdString>& emitted, cmTarget &target)
|
||||
{
|
||||
cmTarget *result;
|
||||
cmLocalUnixMakefileGenerator3 *lg3;
|
||||
|
||||
// first check the same dir as the current target
|
||||
lg3 = static_cast<cmLocalUnixMakefileGenerator3 *>
|
||||
(target.GetMakefile()->GetLocalGenerator());
|
||||
result = target.GetMakefile()->FindTarget(name);
|
||||
|
||||
// search each local generator until a match is found
|
||||
if (!result)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_LocalGenerators.size(); ++i)
|
||||
{
|
||||
// search all targets
|
||||
result = m_LocalGenerators[i]->GetMakefile()->FindTarget(name);
|
||||
if (result)
|
||||
{
|
||||
lg3 = static_cast<cmLocalUnixMakefileGenerator3 *>
|
||||
(m_LocalGenerators[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if a match was found then ...
|
||||
if (result)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3 *lg3 =
|
||||
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
|
||||
std::string tgtName = lg3->GetRelativeTargetDirectory(*result);
|
||||
tgtName += "/all";
|
||||
depends.push_back(tgtName);
|
||||
|
@ -922,14 +938,13 @@ cmGlobalUnixMakefileGenerator3
|
|||
{
|
||||
// Add this dependency.
|
||||
this->AppendAnyGlobalDepend(depends, lib->first.c_str(),
|
||||
emitted);
|
||||
emitted, *result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
|
|
|
@ -111,7 +111,9 @@ protected:
|
|||
void AppendGlobalTargetDepends(std::vector<std::string>& depends,
|
||||
cmTarget& target);
|
||||
void AppendAnyGlobalDepend(std::vector<std::string>& depends,
|
||||
const char* name, std::set<cmStdString>& emitted);
|
||||
const char* name,
|
||||
std::set<cmStdString>& emitted,
|
||||
cmTarget &target);
|
||||
|
||||
// does this generator need a requires step for any of its targets
|
||||
bool NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg, const char *);
|
||||
|
|
|
@ -701,6 +701,7 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
|
|||
cmTarget target;
|
||||
target.SetType(cmTarget::UTILITY, utilityName);
|
||||
target.SetInAll(all);
|
||||
target.SetMakefile(this);
|
||||
|
||||
// Store the custom command in the target.
|
||||
cmCustomCommand cc(output, depends, commandLines, 0);
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
|
||||
///! Set the cmMakefile that owns this target
|
||||
void SetMakefile(cmMakefile *mf) { m_Makefile = mf; };
|
||||
cmMakefile *GetMakefile() { return m_Makefile;};
|
||||
|
||||
/**
|
||||
* Get the list of the custom commands for this target
|
||||
|
|
Loading…
Reference in New Issue