Browse Source

Ninja: Convert object file names to ninja paths earlier

In WriteObjectBuildStatement we pass object file names and directories
to several places that expect paths as Ninja sees them.  Convert them to
Ninja paths before all such uses.
Nicolas Despres 9 years ago
parent
commit
ac3cdd9af2
1 changed files with 6 additions and 4 deletions
  1. 6 4
      Source/cmNinjaTargetGenerator.cxx

+ 6 - 4
Source/cmNinjaTargetGenerator.cxx

@@ -521,8 +521,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
   std::string const language = source->GetLanguage();
   std::string const language = source->GetLanguage();
   std::string const sourceFileName =
   std::string const sourceFileName =
     language == "RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
     language == "RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
-  std::string const objectDir = this->GeneratorTarget->GetSupportDirectory();
-  std::string const objectFileName = this->GetObjectFilePath(source);
+  std::string const objectDir =
+    this->ConvertToNinjaPath(this->GeneratorTarget->GetSupportDirectory());
+  std::string const objectFileName =
+    this->ConvertToNinjaPath(this->GetObjectFilePath(source));
   std::string const objectFileDir =
   std::string const objectFileDir =
     cmSystemTools::GetFilenamePath(objectFileName);
     cmSystemTools::GetFilenamePath(objectFileName);
 
 
@@ -582,9 +584,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
   EnsureParentDirectoryExists(objectFileName);
   EnsureParentDirectoryExists(objectFileName);
 
 
   vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
   vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-    ConvertToNinjaPath(objectDir), cmLocalGenerator::SHELL);
+    objectDir, cmLocalGenerator::SHELL);
   vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
   vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-    ConvertToNinjaPath(objectFileDir), cmLocalGenerator::SHELL);
+    objectFileDir, cmLocalGenerator::SHELL);
 
 
   this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
   this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
                              vars);
                              vars);