[cmake-commits] king committed cmLocalGenerator.cxx 1.258 1.259 cmLocalGenerator.h 1.99 1.100

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jan 23 13:03:05 EST 2008


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

Modified Files:
	cmLocalGenerator.cxx cmLocalGenerator.h 
Log Message:
BUG: Work-around bug in MSVC 6 command line parsing.


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- cmLocalGenerator.cxx	22 Jan 2008 14:13:03 -0000	1.258
+++ cmLocalGenerator.cxx	23 Jan 2008 18:03:03 -0000	1.259
@@ -1451,6 +1451,39 @@
     }
 }
 
+std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  // Work-ardound MSVC 6 command line bug.  This block is only needed
+  // on windows when we are really using the MSVC 6.0 compiler command
+  // line.
+  if(this->Makefile->IsOn("MSVC60"))
+    {
+    // Search for the last space.
+    std::string::size_type pos = lib.rfind(' ');
+    if(pos != lib.npos)
+      {
+      // Find the slash after the last space, if any.
+      pos = lib.find('/', pos);
+
+      // Convert the portion of the path with a space to a short path.
+      std::string sp;
+      if(cmSystemTools::GetShortPath(lib.substr(0, pos).c_str(), sp))
+        {
+        // Append the rest of the path with no space.
+        sp += lib.substr(pos);
+
+        // Convert to an output path.
+        return this->Convert(sp.c_str(), NONE, SHELL);
+        }
+      }
+    }
+#endif
+
+  // Normal behavior.
+  return this->Convert(lib.c_str(), START_OUTPUT, SHELL);
+}
+
 bool cmLocalGenerator::GetLinkerArgs(std::string& rpath, 
                                      std::string& linkLibs,
                                      cmTarget& tgt,
@@ -1554,7 +1587,7 @@
     {
     if(li->IsPath)
       {
-      linkLibs += this->Convert(li->Value.c_str(), START_OUTPUT, SHELL);
+      linkLibs += this->ConvertToLinkReference(li->Value);
       }
     else
       {

Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- cmLocalGenerator.h	22 Jan 2008 14:13:03 -0000	1.99
+++ cmLocalGenerator.h	23 Jan 2008 18:03:03 -0000	1.100
@@ -327,6 +327,8 @@
   std::string FindRelativePathTopBinary();
   void SetupPathConversions();
 
+  std::string ConvertToLinkReference(std::string const& lib);
+
   /** Check whether the native build system supports the given
       definition.  Issues a warning.  */
   virtual bool CheckDefinition(std::string const& define) const;



More information about the Cmake-commits mailing list