perf improvement
This commit is contained in:
parent
116f39d840
commit
b56dcc2a30
|
@ -40,6 +40,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
|
||||||
std::vector<std::string>::const_iterator j = m_Args.begin();
|
std::vector<std::string>::const_iterator j = m_Args.begin();
|
||||||
++j;
|
++j;
|
||||||
|
|
||||||
|
std::string tmps;
|
||||||
|
cmListFileArgument arg;
|
||||||
for( ; j != m_Args.end(); ++j)
|
for( ; j != m_Args.end(); ++j)
|
||||||
{
|
{
|
||||||
// Invoke all the functions that were collected in the block.
|
// Invoke all the functions that were collected in the block.
|
||||||
|
@ -52,9 +54,10 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
|
||||||
m_Functions[c].m_Arguments.begin();
|
m_Functions[c].m_Arguments.begin();
|
||||||
k != m_Functions[c].m_Arguments.end(); ++k)
|
k != m_Functions[c].m_Arguments.end(); ++k)
|
||||||
{
|
{
|
||||||
std::string tmps = k->Value;
|
tmps = k->Value;
|
||||||
cmSystemTools::ReplaceString(tmps, variable.c_str(), j->c_str());
|
cmSystemTools::ReplaceString(tmps, variable.c_str(), j->c_str());
|
||||||
cmListFileArgument arg(tmps, k->Quoted);
|
arg.Value = tmps;
|
||||||
|
arg.Quoted = k->Quoted;
|
||||||
newLFF.m_Arguments.push_back(arg);
|
newLFF.m_Arguments.push_back(arg);
|
||||||
}
|
}
|
||||||
mf.ExecuteCommand(newLFF);
|
mf.ExecuteCommand(newLFF);
|
||||||
|
|
|
@ -44,6 +44,9 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
|
||||||
// so we look for macro invocations
|
// so we look for macro invocations
|
||||||
if(lff.m_Name == m_Args[0])
|
if(lff.m_Name == m_Args[0])
|
||||||
{
|
{
|
||||||
|
std::string tmps;
|
||||||
|
cmListFileArgument arg;
|
||||||
|
std::string variable;
|
||||||
// Expand the argument list to the macro.
|
// Expand the argument list to the macro.
|
||||||
std::vector<std::string> expandedArguments;
|
std::vector<std::string> expandedArguments;
|
||||||
mf.ExpandArguments(lff.m_Arguments, expandedArguments);
|
mf.ExpandArguments(lff.m_Arguments, expandedArguments);
|
||||||
|
@ -71,16 +74,17 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
|
||||||
m_Functions[c].m_Arguments.begin();
|
m_Functions[c].m_Arguments.begin();
|
||||||
k != m_Functions[c].m_Arguments.end(); ++k)
|
k != m_Functions[c].m_Arguments.end(); ++k)
|
||||||
{
|
{
|
||||||
std::string tmps = k->Value;
|
tmps = k->Value;
|
||||||
for (unsigned int j = 1; j < m_Args.size(); ++j)
|
for (unsigned int j = 1; j < m_Args.size(); ++j)
|
||||||
{
|
{
|
||||||
std::string variable = "${";
|
variable = "${";
|
||||||
variable += m_Args[j];
|
variable += m_Args[j];
|
||||||
variable += "}";
|
variable += "}";
|
||||||
cmSystemTools::ReplaceString(tmps, variable.c_str(),
|
cmSystemTools::ReplaceString(tmps, variable.c_str(),
|
||||||
expandedArguments[j-1].c_str());
|
expandedArguments[j-1].c_str());
|
||||||
}
|
}
|
||||||
cmListFileArgument arg(tmps, k->Quoted);
|
arg.Value = tmps;
|
||||||
|
arg.Quoted = k->Quoted;
|
||||||
newLFF.m_Arguments.push_back(arg);
|
newLFF.m_Arguments.push_back(arg);
|
||||||
}
|
}
|
||||||
if(!mf.ExecuteCommand(newLFF))
|
if(!mf.ExecuteCommand(newLFF))
|
||||||
|
|
Loading…
Reference in New Issue