Răsfoiți Sursa

Merge topic 'ninja_add_custom_command_windows'

e7c58f6 Ninja: use cd /D to set directory on Windows
Brad King 12 ani în urmă
părinte
comite
8ec007083e
1 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 6 1
      Source/cmLocalNinjaGenerator.cxx

+ 6 - 1
Source/cmLocalNinjaGenerator.cxx

@@ -302,7 +302,12 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc,
       wd = this->GetMakefile()->GetStartOutputDirectory();
 
     cmOStringStream cdCmd;
-    cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL);
+#ifdef _WIN32
+        std::string cdStr = "cd /D ";
+#else
+        std::string cdStr = "cd ";
+#endif
+    cdCmd << cdStr << this->ConvertToOutputFormat(wd, SHELL);
     cmdLines.push_back(cdCmd.str());
   }
   for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) {