diff options
author | Brad King <brad.king@kitware.com> | 2008-02-20 19:56:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-20 19:56:29 (GMT) |
commit | 454da64c99200de6c1b11ef79f5ef67f4767cf16 (patch) | |
tree | 09c6306faa9c8373f16868ebf1ba683be477ca0f | |
parent | 5e72a0d4e4e5ddd6817b294942af41dbb76b1e01 (diff) | |
download | CMake-454da64c99200de6c1b11ef79f5ef67f4767cf16.zip CMake-454da64c99200de6c1b11ef79f5ef67f4767cf16.tar.gz CMake-454da64c99200de6c1b11ef79f5ef67f4767cf16.tar.bz2 |
BUG: Link scripts should be generated with copy-if-different and included as a dependency of the link rule.
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.h | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index c1c3b63..9e8d42d 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -405,7 +405,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) { // Use a link script. const char* name = (relink? "relink.txt" : "link.txt"); - this->CreateLinkScript(name, real_link_commands, commands1); + this->CreateLinkScript(name, real_link_commands, commands1, depends); } else { diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index bb68d36..dd4c9eb 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -788,7 +788,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules { // Use a link script. const char* name = (relink? "relink.txt" : "link.txt"); - this->CreateLinkScript(name, real_link_commands, commands1); + this->CreateLinkScript(name, real_link_commands, commands1, depends); } else { diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 135b199..08cf6df 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1563,13 +1563,15 @@ void cmMakefileTargetGenerator ::CreateLinkScript(const char* name, 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. std::string linkScriptName = this->TargetBuildDirectoryFull; linkScriptName += "/"; linkScriptName += name; cmGeneratedFileStream linkScriptStream(linkScriptName.c_str()); + linkScriptStream.SetCopyIfDifferent(true); for(std::vector<std::string>::const_iterator cmd = link_commands.begin(); cmd != link_commands.end(); ++cmd) { @@ -1588,6 +1590,7 @@ cmMakefileTargetGenerator cmLocalGenerator::SHELL); link_command += " --verbose=$(VERBOSE)"; makefile_commands.push_back(link_command); + makefile_depends.push_back(linkScriptName); } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 34a736a..1039f3d 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -134,7 +134,8 @@ protected: script at build time. */ void CreateLinkScript(const char* name, 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(); void RemoveForbiddenFlags(const char* flagVar, const char* linkLang, |