浏览代码

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 年之前
父节点
当前提交
ac3cdd9af2
共有 1 个文件被更改,包括 6 次插入4 次删除
  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 sourceFileName =
     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 =
     cmSystemTools::GetFilenamePath(objectFileName);
 
@@ -582,9 +584,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
   EnsureParentDirectoryExists(objectFileName);
 
   vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-    ConvertToNinjaPath(objectDir), cmLocalGenerator::SHELL);
+    objectDir, cmLocalGenerator::SHELL);
   vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-    ConvertToNinjaPath(objectFileDir), cmLocalGenerator::SHELL);
+    objectFileDir, cmLocalGenerator::SHELL);
 
   this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
                              vars);