소스 검색

Use forward slashes for objects in response files

Response files are parsed by tools, not by shells.  We teach
cmLocalGenerator::Convert() a new "RESPONSE" output format and use it
for objects listed in response files.  It does not do special slash or
MSYS root translation like the "SHELL" format does.  This is necessary
for GNU tools on Windows to understand response file content.

See issue #10401.
Brad King 15 년 전
부모
커밋
87f0853941
3개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 0
      Source/cmLocalGenerator.cxx
  2. 1 1
      Source/cmLocalGenerator.h
  3. 1 1
      Source/cmMakefileTargetGenerator.cxx

+ 4 - 0
Source/cmLocalGenerator.cxx

@@ -2247,6 +2247,10 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const char* source,
       }
       }
     result = this->EscapeForShell(result.c_str(), true, false);
     result = this->EscapeForShell(result.c_str(), true, false);
     }
     }
+  else if(output == RESPONSE)
+    {
+    result = this->EscapeForShell(result.c_str(), false, false);
+    }
   return result;
   return result;
 }
 }
 
 

+ 1 - 1
Source/cmLocalGenerator.h

@@ -102,7 +102,7 @@ public:
    * path setting
    * path setting
    */
    */
   enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
   enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
-  enum OutputFormat { UNCHANGED, MAKEFILE, SHELL };
+  enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
   std::string ConvertToOutputFormat(const char* source, OutputFormat output);
   std::string ConvertToOutputFormat(const char* source, OutputFormat output);
   std::string Convert(const char* remote, RelativeRoot local,
   std::string Convert(const char* remote, RelativeRoot local,
                       OutputFormat output = UNCHANGED,
                       OutputFormat output = UNCHANGED,

+ 1 - 1
Source/cmMakefileTargetGenerator.cxx

@@ -1329,7 +1329,7 @@ public:
     this->NextObject =
     this->NextObject =
       this->LocalGenerator->Convert(obj.c_str(),
       this->LocalGenerator->Convert(obj.c_str(),
                                     cmLocalGenerator::START_OUTPUT,
                                     cmLocalGenerator::START_OUTPUT,
-                                    cmLocalGenerator::SHELL);
+                                    cmLocalGenerator::RESPONSE);
 
 
     // Roll over to next string if the limit will be exceeded.
     // Roll over to next string if the limit will be exceeded.
     if(this->LengthLimit != std::string::npos &&
     if(this->LengthLimit != std::string::npos &&