Переглянути джерело

Ninja/Swift: Remove redundant calls to ConvertToNinjaPath

`GetSourceFilePath` already handles converting to a Ninja path.
Brad King 4 роки тому
батько
коміт
ef553410e2

+ 3 - 5
Source/cmNinjaNormalTargetGenerator.cxx

@@ -1072,9 +1072,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
       cmLocalGenerator const* LocalGen = this->GetLocalGenerator();
       for (const auto& source : sources) {
         oss << " "
-            << LocalGen->ConvertToOutputFormat(
-                 this->ConvertToNinjaPath(this->GetSourceFilePath(source)),
-                 cmOutputConverter::SHELL);
+            << LocalGen->ConvertToOutputFormat(this->GetSourceFilePath(source),
+                                               cmOutputConverter::SHELL);
       }
       return oss.str();
     }();
@@ -1094,8 +1093,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
     for (const auto& source : sources) {
       linkBuild.Outputs.push_back(
         this->ConvertToNinjaPath(this->GetObjectFilePath(source, config)));
-      linkBuild.ExplicitDeps.push_back(
-        this->ConvertToNinjaPath(this->GetSourceFilePath(source)));
+      linkBuild.ExplicitDeps.emplace_back(this->GetSourceFilePath(source));
     }
     linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
   } else {

+ 1 - 2
Source/cmNinjaTargetGenerator.cxx

@@ -1575,8 +1575,7 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
 void cmNinjaTargetGenerator::EmitSwiftDependencyInfo(
   cmSourceFile const* source, const std::string& config)
 {
-  std::string const sourceFilePath =
-    this->ConvertToNinjaPath(this->GetSourceFilePath(source));
+  std::string const sourceFilePath = this->GetSourceFilePath(source);
   std::string const objectFilePath =
     this->ConvertToNinjaPath(this->GetObjectFilePath(source, config));
   std::string const swiftDepsPath = [source, objectFilePath]() -> std::string {