[cmake-commits] king committed cmGlobalXCodeGenerator.cxx 1.183 1.184 cmMakefileLibraryTargetGenerator.cxx 1.53 1.54 cmTarget.cxx 1.193 1.194

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 7 16:49:13 EST 2008


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

Modified Files:
	cmGlobalXCodeGenerator.cxx 
	cmMakefileLibraryTargetGenerator.cxx cmTarget.cxx 
Log Message:
ENH: Avoid computing link information for static library targets.  They do not link.


Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- cmMakefileLibraryTargetGenerator.cxx	30 Jan 2008 02:16:49 -0000	1.53
+++ cmMakefileLibraryTargetGenerator.cxx	7 Feb 2008 21:49:11 -0000	1.54
@@ -720,7 +720,11 @@
 
   // Collect up flags to link in needed libraries.
   cmOStringStream linklibs;
-  this->LocalGenerator->OutputLinkLibraries(linklibs, *this->Target, relink);
+  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+    {
+    this->LocalGenerator
+      ->OutputLinkLibraries(linklibs, *this->Target, relink);
+    }
 
   // Construct object file lists that may be needed to expand the
   // rule.

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- cmGlobalXCodeGenerator.cxx	29 Jan 2008 20:07:33 -0000	1.183
+++ cmGlobalXCodeGenerator.cxx	7 Feb 2008 21:49:11 -0000	1.184
@@ -2092,6 +2092,12 @@
       } 
     }
 
+  // Skip link information for static libraries.
+  if(cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
+    {
+    return;
+    }
+
   // Loop over configuration types and set per-configuration info.
   for(std::vector<std::string>::iterator i =
         this->CurrentConfigurationTypes.begin();
@@ -2166,29 +2172,28 @@
     }
 
     // now add the link libraries
-    if(cmtarget->GetType() != cmTarget::STATIC_LIBRARY)
+    {
+    std::string linkLibs;
+    const char* sep = "";
+    typedef cmComputeLinkInformation::ItemVector ItemVector;
+    ItemVector const& libNames = cli.GetItems();
+    for(ItemVector::const_iterator li = libNames.begin();
+        li != libNames.end(); ++li)
       {
-      std::string linkLibs;
-      const char* sep = "";
-      typedef cmComputeLinkInformation::ItemVector ItemVector;
-      ItemVector const& libNames = cli.GetItems();
-      for(ItemVector::const_iterator li = libNames.begin();
-          li != libNames.end(); ++li)
+      linkLibs += sep;
+      sep = " ";
+      if(li->IsPath)
         {
-        linkLibs += sep;
-        sep = " ";
-        if(li->IsPath)
-          {
-          linkLibs += this->XCodeEscapePath(li->Value.c_str());
-          }
-        else
-          {
-          linkLibs += li->Value;
-          }
+        linkLibs += this->XCodeEscapePath(li->Value.c_str());
+        }
+      else
+        {
+        linkLibs += li->Value;
         }
-      this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
-                                        linkLibs.c_str(), configName);
       }
+    this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
+                                      linkLibs.c_str(), configName);
+    }
     }
 }
 

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- cmTarget.cxx	6 Feb 2008 19:19:03 -0000	1.193
+++ cmTarget.cxx	7 Feb 2008 21:49:11 -0000	1.194
@@ -3299,6 +3299,9 @@
 cmComputeLinkInformation*
 cmTarget::GetLinkInformation(const char* config)
 {
+  // Link information does not make sense for static libraries.
+  assert(this->GetType() != cmTarget::STATIC_LIBRARY);
+
   // Lookup any existing information for this configuration.
   std::map<cmStdString, cmComputeLinkInformation*>::iterator
     i = this->LinkInformation.find(config?config:"");



More information about the Cmake-commits mailing list