BUG: Libraries and executables that are built with version numbers and symlinks should be built by a rule using the real file name. The symlink file names should be rules that just depend on the main rule. This way if a version number changes a target will re-link with the new name and the symlinks will be updated.
This commit is contained in:
parent
932c5b74b8
commit
5b95c0a881
|
@ -1464,7 +1464,19 @@ cmLocalUnixMakefileGenerator3
|
|||
|
||||
// Write the build rule.
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPath.c_str(), depends, commands);
|
||||
targetFullPathReal.c_str(), depends, commands);
|
||||
|
||||
// The symlink name for the target should depend on the real target
|
||||
// so if the target version changes it rebuilds and recreates the
|
||||
// symlink.
|
||||
if(targetFullPath != targetFullPathReal)
|
||||
{
|
||||
depends.clear();
|
||||
commands.clear();
|
||||
depends.push_back(targetFullPathReal.c_str());
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPath.c_str(), depends, commands);
|
||||
}
|
||||
|
||||
// Write convenience targets.
|
||||
std::string dir = m_Makefile->GetStartOutputDirectory();
|
||||
|
@ -1794,11 +1806,29 @@ cmLocalUnixMakefileGenerator3
|
|||
linkFlags.c_str());
|
||||
}
|
||||
|
||||
// from here down is the same for exe or lib
|
||||
|
||||
// Write the build rule.
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPath.c_str(), depends, commands);
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPathReal.c_str(), depends, commands);
|
||||
|
||||
// The symlink names for the target should depend on the real target
|
||||
// so if the target version changes it rebuilds and recreates the
|
||||
// symlinks.
|
||||
if(targetFullPathSO != targetFullPathReal)
|
||||
{
|
||||
depends.clear();
|
||||
commands.clear();
|
||||
depends.push_back(targetFullPathReal.c_str());
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPathSO.c_str(), depends, commands);
|
||||
}
|
||||
if(targetFullPath != targetFullPathSO)
|
||||
{
|
||||
depends.clear();
|
||||
commands.clear();
|
||||
depends.push_back(targetFullPathSO.c_str());
|
||||
this->WriteMakeRule(ruleFileStream, 0,
|
||||
targetFullPath.c_str(), depends, commands);
|
||||
}
|
||||
|
||||
// Write convenience targets.
|
||||
std::string dir = m_Makefile->GetStartOutputDirectory();
|
||||
|
|
Loading…
Reference in New Issue