[cmake-commits] king committed cmMakefileExecutableTargetGenerator.cxx 1.44 1.45 cmMakefileLibraryTargetGenerator.cxx 1.56 1.57 cmMakefileTargetGenerator.cxx 1.90 1.91 cmMakefileTargetGenerator.h 1.22 1.23

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Feb 20 14:56:31 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv14597/Source

Modified Files:
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.cxx 
	cmMakefileTargetGenerator.cxx cmMakefileTargetGenerator.h 
Log Message:
BUG: Link scripts should be generated with copy-if-different and included as a dependency of the link rule.


Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- cmMakefileLibraryTargetGenerator.cxx	18 Feb 2008 21:38:34 -0000	1.56
+++ cmMakefileLibraryTargetGenerator.cxx	20 Feb 2008 19:56:29 -0000	1.57
@@ -788,7 +788,7 @@
     {
     // 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
     {

Index: cmMakefileTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmMakefileTargetGenerator.h	18 Feb 2008 21:38:34 -0000	1.22
+++ cmMakefileTargetGenerator.h	20 Feb 2008 19:56:29 -0000	1.23
@@ -134,7 +134,8 @@
       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,

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- cmMakefileExecutableTargetGenerator.cxx	18 Feb 2008 21:38:34 -0000	1.44
+++ cmMakefileExecutableTargetGenerator.cxx	20 Feb 2008 19:56:29 -0000	1.45
@@ -405,7 +405,7 @@
     {
     // 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
     {

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- cmMakefileTargetGenerator.cxx	18 Feb 2008 21:38:34 -0000	1.90
+++ cmMakefileTargetGenerator.cxx	20 Feb 2008 19:56:29 -0000	1.91
@@ -1563,13 +1563,15 @@
 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 @@
                                 cmLocalGenerator::SHELL);
   link_command += " --verbose=$(VERBOSE)";
   makefile_commands.push_back(link_command);
+  makefile_depends.push_back(linkScriptName);
 }
 
 //----------------------------------------------------------------------------



More information about the Cmake-commits mailing list