BUG: Link scripts should be generated with copy-if-different and included as a dependency of the link rule.
This commit is contained in:
parent
5e72a0d4e4
commit
454da64c99
@ -405,7 +405,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
{
|
{
|
||||||
// Use a link script.
|
// Use a link script.
|
||||||
const char* name = (relink? "relink.txt" : "link.txt");
|
const char* name = (relink? "relink.txt" : "link.txt");
|
||||||
this->CreateLinkScript(name, real_link_commands, commands1);
|
this->CreateLinkScript(name, real_link_commands, commands1, depends);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -788,7 +788,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||||||
{
|
{
|
||||||
// Use a link script.
|
// Use a link script.
|
||||||
const char* name = (relink? "relink.txt" : "link.txt");
|
const char* name = (relink? "relink.txt" : "link.txt");
|
||||||
this->CreateLinkScript(name, real_link_commands, commands1);
|
this->CreateLinkScript(name, real_link_commands, commands1, depends);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1563,13 +1563,15 @@ void
|
|||||||
cmMakefileTargetGenerator
|
cmMakefileTargetGenerator
|
||||||
::CreateLinkScript(const char* name,
|
::CreateLinkScript(const char* name,
|
||||||
std::vector<std::string> const& link_commands,
|
std::vector<std::string> const& link_commands,
|
||||||
std::vector<std::string>& makefile_commands)
|
std::vector<std::string>& makefile_commands,
|
||||||
|
std::vector<std::string>& makefile_depends)
|
||||||
{
|
{
|
||||||
// Create the link script file.
|
// Create the link script file.
|
||||||
std::string linkScriptName = this->TargetBuildDirectoryFull;
|
std::string linkScriptName = this->TargetBuildDirectoryFull;
|
||||||
linkScriptName += "/";
|
linkScriptName += "/";
|
||||||
linkScriptName += name;
|
linkScriptName += name;
|
||||||
cmGeneratedFileStream linkScriptStream(linkScriptName.c_str());
|
cmGeneratedFileStream linkScriptStream(linkScriptName.c_str());
|
||||||
|
linkScriptStream.SetCopyIfDifferent(true);
|
||||||
for(std::vector<std::string>::const_iterator cmd = link_commands.begin();
|
for(std::vector<std::string>::const_iterator cmd = link_commands.begin();
|
||||||
cmd != link_commands.end(); ++cmd)
|
cmd != link_commands.end(); ++cmd)
|
||||||
{
|
{
|
||||||
@ -1588,6 +1590,7 @@ cmMakefileTargetGenerator
|
|||||||
cmLocalGenerator::SHELL);
|
cmLocalGenerator::SHELL);
|
||||||
link_command += " --verbose=$(VERBOSE)";
|
link_command += " --verbose=$(VERBOSE)";
|
||||||
makefile_commands.push_back(link_command);
|
makefile_commands.push_back(link_command);
|
||||||
|
makefile_depends.push_back(linkScriptName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -134,7 +134,8 @@ protected:
|
|||||||
script at build time. */
|
script at build time. */
|
||||||
void CreateLinkScript(const char* name,
|
void CreateLinkScript(const char* name,
|
||||||
std::vector<std::string> const& link_commands,
|
std::vector<std::string> const& link_commands,
|
||||||
std::vector<std::string>& makefile_commands);
|
std::vector<std::string>& makefile_commands,
|
||||||
|
std::vector<std::string>& makefile_depends);
|
||||||
|
|
||||||
virtual void CloseFileStreams();
|
virtual void CloseFileStreams();
|
||||||
void RemoveForbiddenFlags(const char* flagVar, const char* linkLang,
|
void RemoveForbiddenFlags(const char* flagVar, const char* linkLang,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user