ENH: Moved generation of the /fast version of GLOBAL_TARGET targets to the proper place in the local generator instead of in the global generator. Also made the install/fast target not depend on the all target.
This commit is contained in:
parent
791706a52f
commit
ad9dd6d11c
|
@ -686,6 +686,8 @@ cmGlobalUnixMakefileGenerator3
|
|||
strlen(t->second.GetName()) &&
|
||||
emitted.insert(t->second.GetName()).second)
|
||||
{
|
||||
// Handle user targets here. Global targets are handled in
|
||||
// the local generator on a per-directory basis.
|
||||
if((t->second.GetType() == cmTarget::EXECUTABLE) ||
|
||||
(t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
|
||||
(t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
|
||||
|
@ -762,18 +764,6 @@ cmGlobalUnixMakefileGenerator3
|
|||
lg->WriteMakeRule(ruleFileStream, "fast build rule for target.",
|
||||
localName.c_str(), depends, commands, true);
|
||||
}
|
||||
else if(t->second.GetType() == cmTarget::GLOBAL_TARGET)
|
||||
{
|
||||
// Provide a fast target for the global targets that just
|
||||
// forwards to the real target so at least it will work.
|
||||
depends.clear();
|
||||
commands.clear();
|
||||
std::string localName = t->second.GetName();
|
||||
depends.push_back(localName);
|
||||
localName += "/fast";
|
||||
lg->WriteMakeRule(ruleFileStream, "fast build rule for target.",
|
||||
localName.c_str(), depends, commands, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1387,7 +1387,7 @@ void cmLocalUnixMakefileGenerator3
|
|||
this->AppendEcho(commands, text,
|
||||
cmLocalUnixMakefileGenerator3::EchoGlobal);
|
||||
|
||||
// Utility targets store their rules in pre- and post-build commands.
|
||||
// Global targets store their rules in pre- and post-build commands.
|
||||
this->AppendCustomDepends(depends,
|
||||
glIt->second.GetPreBuildCommands());
|
||||
this->AppendCustomDepends(depends,
|
||||
|
@ -1396,8 +1396,27 @@ void cmLocalUnixMakefileGenerator3
|
|||
glIt->second.GetPreBuildCommands());
|
||||
this->AppendCustomCommands(commands,
|
||||
glIt->second.GetPostBuildCommands());
|
||||
std::string targetName = glIt->second.GetName();
|
||||
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
||||
glIt->first.c_str(), depends, commands, true);
|
||||
targetName.c_str(), depends, commands, true);
|
||||
|
||||
// Provide a "/fast" version of the target.
|
||||
depends.clear();
|
||||
if(targetName == "install")
|
||||
{
|
||||
// Provide a fast install target that does not depend on all
|
||||
// but has the same command.
|
||||
depends.push_back("preinstall/fast");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just forward to the real target so at least it will work.
|
||||
depends.push_back(targetName);
|
||||
commands.clear();
|
||||
}
|
||||
targetName += "/fast";
|
||||
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
||||
targetName.c_str(), depends, commands, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue