ENH: some performance improvements
This commit is contained in:
parent
1137970d54
commit
1e78125a7b
@ -101,7 +101,11 @@ void cmGlobalUnixMakefileGenerator3::Generate()
|
|||||||
this->WriteMainCMakefile();
|
this->WriteMainCMakefile();
|
||||||
|
|
||||||
// now write the support Makefiles
|
// now write the support Makefiles
|
||||||
this->WriteBuildMakefile();
|
|
||||||
|
// we no longr use the build makefile, TODO remove this code and the code
|
||||||
|
// it makes use of later on
|
||||||
|
// this->WriteBuildMakefile();
|
||||||
|
|
||||||
this->WriteCleanMakefile();
|
this->WriteCleanMakefile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,20 +508,25 @@ cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
// Add a rule to build the target by name.
|
// Add a rule to build the target by name.
|
||||||
localName = lg->GetRelativeTargetDirectory(t->second);
|
localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
|
std::string makefileName = localName;
|
||||||
|
makefileName += "/build.make";
|
||||||
|
|
||||||
commands.clear();
|
commands.clear();
|
||||||
if (t->second.GetType() != cmTarget::UTILITY)
|
if (t->second.GetType() != cmTarget::UTILITY)
|
||||||
{
|
{
|
||||||
makeTargetName = localName;
|
makeTargetName = localName;
|
||||||
makeTargetName += "/depend";
|
makeTargetName += "/depend";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
|
commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(),
|
||||||
|
makeTargetName.c_str()));
|
||||||
makeTargetName = localName;
|
makeTargetName = localName;
|
||||||
makeTargetName += "/requires";
|
makeTargetName += "/requires";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
|
commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(),
|
||||||
|
makeTargetName.c_str()));
|
||||||
}
|
}
|
||||||
makeTargetName = localName;
|
makeTargetName = localName;
|
||||||
makeTargetName += "/build";
|
makeTargetName += "/build";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
|
commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(),
|
||||||
|
makeTargetName.c_str()));
|
||||||
|
|
||||||
// Write the rule.
|
// Write the rule.
|
||||||
localName += "/all";
|
localName += "/all";
|
||||||
|
@ -60,6 +60,11 @@ void cmLocalUnixMakefileGenerator3::Generate()
|
|||||||
// Setup our configuration variables for this directory.
|
// Setup our configuration variables for this directory.
|
||||||
this->ConfigureOutputPaths();
|
this->ConfigureOutputPaths();
|
||||||
|
|
||||||
|
// write the custom commands, this must happen before writing the targets,
|
||||||
|
// but... it may be that it needs to happen after the TraveVSDependencies
|
||||||
|
// call
|
||||||
|
this->WriteCustomCommands();
|
||||||
|
|
||||||
// Generate the rule files for each target.
|
// Generate the rule files for each target.
|
||||||
cmTargets& targets = m_Makefile->GetTargets();
|
cmTargets& targets = m_Makefile->GetTargets();
|
||||||
std::string empty;
|
std::string empty;
|
||||||
@ -80,8 +85,6 @@ void cmLocalUnixMakefileGenerator3::Generate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->WriteCustomCommands();
|
|
||||||
|
|
||||||
// write the local Makefile
|
// write the local Makefile
|
||||||
this->WriteLocalMakefile();
|
this->WriteLocalMakefile();
|
||||||
|
|
||||||
@ -377,6 +380,21 @@ cmLocalUnixMakefileGenerator3
|
|||||||
}
|
}
|
||||||
this->WriteDisclaimer(ruleFileStream);
|
this->WriteDisclaimer(ruleFileStream);
|
||||||
|
|
||||||
|
this->WriteMakeVariables(ruleFileStream);
|
||||||
|
|
||||||
|
// include the custom commands rules
|
||||||
|
if (m_CustomRuleFiles.size())
|
||||||
|
{
|
||||||
|
// do the include
|
||||||
|
std::string dir = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dir += "/CMakeCustomRules.dir/build.make";
|
||||||
|
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
|
||||||
|
ruleFileStream
|
||||||
|
<< m_IncludeDirective << " "
|
||||||
|
<< this->ConvertToOutputForExisting(dir.c_str()).c_str()
|
||||||
|
<< "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Include the rule file for each object.
|
// Include the rule file for each object.
|
||||||
std::string relPath = this->GetHomeRelativeOutputPath();
|
std::string relPath = this->GetHomeRelativeOutputPath();
|
||||||
std::string objTarget;
|
std::string objTarget;
|
||||||
@ -821,9 +839,23 @@ cmLocalUnixMakefileGenerator3
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->WriteDisclaimer(ruleFileStream);
|
this->WriteDisclaimer(ruleFileStream);
|
||||||
|
this->WriteMakeVariables(ruleFileStream);
|
||||||
ruleFileStream
|
ruleFileStream
|
||||||
<< "# Utility rule file for " << target.GetName() << ".\n\n";
|
<< "# Utility rule file for " << target.GetName() << ".\n\n";
|
||||||
|
|
||||||
|
// include the custom commands rules
|
||||||
|
if (m_CustomRuleFiles.size())
|
||||||
|
{
|
||||||
|
// do the include
|
||||||
|
std::string dir = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dir += "/CMakeCustomRules.dir/build.make";
|
||||||
|
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
|
||||||
|
ruleFileStream
|
||||||
|
<< m_IncludeDirective << " "
|
||||||
|
<< this->ConvertToOutputForExisting(dir.c_str()).c_str()
|
||||||
|
<< "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Collect the commands and dependencies.
|
// Collect the commands and dependencies.
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
@ -2300,6 +2332,12 @@ cmLocalUnixMakefileGenerator3
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loop over all utility dependencies.
|
// Loop over all utility dependencies.
|
||||||
|
|
||||||
|
// Ken --- we trust that the parent build system handled the utility
|
||||||
|
// targets, really we trust that it also handled the libs but there is no
|
||||||
|
// harm in listing the libs as depends, if the libs are not present they
|
||||||
|
// cannot be built (the rules are not there) but at least it will squak
|
||||||
|
#if 0
|
||||||
const std::set<cmStdString>& tutils = target.GetUtilities();
|
const std::set<cmStdString>& tutils = target.GetUtilities();
|
||||||
for(std::set<cmStdString>::const_iterator util = tutils.begin();
|
for(std::set<cmStdString>::const_iterator util = tutils.begin();
|
||||||
util != tutils.end(); ++util)
|
util != tutils.end(); ++util)
|
||||||
@ -2311,6 +2349,7 @@ cmLocalUnixMakefileGenerator3
|
|||||||
this->AppendAnyDepend(depends, util->c_str());
|
this->AppendAnyDepend(depends, util->c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user